Sphinx: Linking to Embedded Binary Files (PDFs)

后端 未结 1 366
长发绾君心
长发绾君心 2021-01-18 10:49

I\'m using sphinx and RST to generate some tech documentation as HTML and having issues getting a local PDF reference to work as a hyperlin

1条回答
  •  走了就别回头了
    2021-01-18 10:54

    The solution I came up with was to just add the PDFs to html_static_path and reference the _static output path in the link instead of the docs path where it lives in the source. Now PDFs open up in the browser instead of having to download them to view.

    Would be great if there was an sphinx extension / directive to handle this (:download-inline:).

    conf.py

    html_static_path = ['_static', 'agile-101/docs']
    

    agile-101.rst

    .. important:: View the agile course on scrum basics
    
    - View `these slides to dive deeper into Agile Basics <../_static/agile-101.pdf>`_. 
    

    0 讨论(0)
提交回复
热议问题