例如,假设我具有以下项目结构
/features
/foo
index.rst
/bar
index.rst
/models
foo.rst
bar.rst
/foo/index.rst
包含以下内容:
Foo Feature
***********
A nice explanation of the Foo feature
See :doc:`/models/foo`
/bar/index.rst
包含以下内容:
Bar Feature
***********
A nice explanation of the Bar feature
See :doc:`/models/bar`
我希望能够同时向/models/foo.rst
和/models/bar.rst
添加指令,以便在使用Sphinx进行渲染时,将生成指向功能页面的链接。
例如,我的/models/foo.rst
可能包含以下内容:
class Foo {
id: number;
title: string;
}
.. magically-insert-back-links: // this is really what i'm looking for
并将呈现为:
class Foo {
id: number;
title: string;
}
Back Links:
- Foo Feature // and this text would be a link back to the Foo Feature page