【发布时间】:2018-07-20 08:40:22
【问题描述】:
我正在开发 sphinx 文档生成器的扩展。
我想在文档的 html 构建中添加一些 html、js、css 和 json 文件。
它们不是模板的一部分,它们不应受到 sphinx 模板中的任何内容的影响。它们只是我想添加到下载文件夹中的文件的查看器。 (我也不怎么样。)
如何在 sphinx 扩展中包含额外的 html 文件? 可以按照https://docs.readthedocs.io/en/latest/guides/adding-custom-css.html 的说明添加 JS/CSS,但没有 html 的功能。
def setup(app):
app.add_stylesheet('css/custom.css')
app.add_javascript("js/custom.js")
# and custom html or any generic file ?
【问题讨论】:
-
sphinx-doc.org/en/master/… 你有
_templates目录吗? -
"(我也不知道如何。)" 你的意思是你不知道如何将文件从源文件复制到构建目录,这实际上是你的问题?
标签: python python-sphinx