问题
I am trying to write a custom role for Sphinx to allow linking to PDF files that are then displayed in the browser (rather than being downloaded when using the :download:
role).
I have got as far as a role that creates a link to the PDF file:
:pdf:`Document Title <pdf/document.pdf>`
generates something like:
<a href="pdf/document.pdf>Document Title</a>
However, I don't know how to get Sphinx to copy the pdf
directory to the output directory.
Is this possible?
回答1:
Use html_static_path in your conf.py
.
html_static_path = ['_static', 'pdf']
来源:https://stackoverflow.com/questions/64215666/custom-role-to-link-pdf-file-as-static-content