reStructuredText超链接引用本地pdf文件

时间:2015-12-02 07:26:04

标签: python-sphinx restructuredtext

nginx_pdf_
.. _nginx_pdf: Mastering Nginx.pdf

掌握Nginx.pdf是带有第一个文件的某个目录中的本地pdf文件。我想如果单击超链接,浏览器将打开pdf文件,但这不起作用。我怎样才能实现这一目标

1 个答案:

答案 0 :(得分:0)

斯芬克斯

只需在项目中创建_downloads文件夹,然后将文件放在那里。然后从第一个文件中调用它:

:download:`_downloads/Mastering Nginx.pdf`

它应该有效。

docutils的

使用下划线替换pdf文件名称中的空格后:

nginx_pdf_

.. _nginx_pdf: Mastering_Nginx.pdf

用以下内容构建:

rst2html test.rst > test.html