我的文档结构如下:
├── common
│ └── shared.rst
├── foo
│ └── foo.rst
├── index.rst
└── zoo
└── zoo.rst
生成的结构如下所示:
├── common
│ └── shared.html (breadcrumbs: home -> zoo -> shared)
├── foo
│ └── foo.html
├── index.html
└── zoo
└── zoo.html
我的foo& toctree动物园看起来像:
.. toctree::
:includehidden:
../common/shared
我想要使用看起来像breadcrumbs: home -> zoo -> shared
的面包屑和另一个breadcrumbs: home -> foo -> shared
来编译2个不同的shared.html文件。用狮身人面像可以吗?
作为参考,这是我的面包屑生成的模板代码:
<section>
<ul class="breadcrumbs">
<li><a href="{{ pathto(master_doc) }}">Home</a></li>
{% for doc in parents %}
<li><a href="{{ doc.link|e }}">{{ doc.title }}</a></li>
{% endfor %}
{% if title != 'LaunchKey Documentation' %}
<li><a href="#" class="active">{{ title }}</a></li>
{% endif %}
</ul>
</section>
答案 0 :(得分:0)
结束在shared.rst
和/foo
中放置/zoo
并使用包含来使用共享副本。
.. include:: ../common/shared.rst