How to do a link to a file in rst with sphinx?

A solution is to use the :download: “role” (detailed in the sphinx documentation on roles).

Here is a short example assuming you have a file mypdf.pdf in a directory doc. The directory doc and your rst file must be in the same directory:

here is a pdf file :download:`pdf <doc/mypdf.pdf>`

Note that you mustn’t put a blank space between :download: and the path to the file.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)