MRo*_*lin 7 html python-sphinx
对于我的项目的大部分文档,我更喜欢标准的 sphinx 布局。然而,对于登陆页面,我更喜欢使用自定义 HTML/CSS/JS,而不使用普通 sphinx 网站的任何布局、目录或侧边栏。有没有一种方法可以在 sphinx 生成的网站中包含原始 HTML 独立页面,而完全忽略网站其余部分的正常布局?
作为一个反例,我知道我可以使用以下内容将原始 HTML 位包含到页面中(另请参阅此问题)
.. raw:: html
:file: myfile-html
Run Code Online (Sandbox Code Playgroud)
然而,这只是将文件嵌入到正常布局中。我想要一个完全独立的 HTML 页面。
我自己刚刚遇到了这个问题,我解决它的方法是简单地将 html 文件包含在我的source/_static
文件夹中,然后使用相对链接引用它。
因此,如果 是source/_static/my_standalone.htm
我拥有非生成的 HTML 文件的路径,并且我想要在其中键入链接的 .rst 文件位于source/otherfolder/index.rst
,我会在我的 rst 中这样写:
Link to my non-Sphinx HTML file
===============================
To get to my standalone, non-generated HTML file,
just `click here <../_static/my_standalone.html>`_ now!
Run Code Online (Sandbox Code Playgroud)