My (sleazy) solution that works for PDF and HTML is to put all my PPT documents in the _static/
directory, configuring the html_static_path
variable, then linking to the desired file, like this:
- Directory Structure
repo-top/
conf.py
_static/
myDocument.pptx
- conf.py
html_static_path = ['_static']
- Your RST file
`Display Text <_static/myDocument.pptx>`_.
Documentation about html_static_path
https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_static_path
This also seems to be the approach here: https://stackoverflow.com/a/67997311/6647191
- I also had to manually replace all absolute file:/// URLs to relative ones using
sed
. You then have to send the PDF along with the _static
directory. This is on Mac
export LC_CTYPE=C
export LANG=C
sed -i '' 's/file:\/\/\/Users\/username\/Desktop\/project/./g' ./_build/filename.pdf
cp -r _static/* ./_build/_static