Sli*_*SFT 7 restructuredtext python-2.7 python-sphinx read-the-docs
我正在使用sphinx和RST将一些技术文档生成为 HTML,并且在将本地 PDF 引用用作超链接时遇到问题。我见过人们:download:用来链接到本地 PDF,但我将 PDF 嵌入到/docs目录中以供参考。我不喜欢,:download:因为它不会在浏览器中内嵌显示 PDF,这需要代表用户执行额外的步骤才能使用。
sphinx-build -b html除非在config.pyhookhtml_static_path或html_extra_path-中指定,否则不会复制任何文件,即使这样,它们也会被放到root目录或_static文件夹中。
是否有在 sphinx 中嵌入链接二进制文件的建议方法,或者这是一种不好的做法?通常,这些链接指向未托管在其他任何地方的幻灯片或设计图。
.. important:: View the agile course on scrum basics
- View `these slides to dive deeper into Agile Basics <docs/agile-101.pdf>`_.
Run Code Online (Sandbox Code Playgroud)
我想出的解决方案是将 PDF 添加到html_static_path并引用_static链接中的输出路径,而不是docs它在源中所在的路径。现在 PDF 可以在浏览器中打开,而无需下载即可查看。
如果有一个 sphinx 扩展/指令来处理这个 ( :download-inline:)会很棒。
html_static_path = ['_static', 'agile-101/docs']
Run Code Online (Sandbox Code Playgroud)
.. important:: View the agile course on scrum basics
- View `these slides to dive deeper into Agile Basics <../_static/agile-101.pdf>`_.
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2085 次 |
| 最近记录: |