Anton
Anton

Reputation: 308

How to create a link to download a directory in rst with sphinx?

A link to a file can be added simply by :download:`Name <doc/name.pdf>`.

Is it possible to do the same for a directory? A naive :download:`Dir <doc/>` does not work

Should it be always pre-archived?

Upvotes: 5

Views: 3431

Answers (1)

Steve Piercy
Steve Piercy

Reputation: 15105

A directory is not a file. The download role:

... lets you link to files within your source tree ... that can be downloaded.

You must make whatever you want to be downloaded downloadable. You would need to tar, zip, or whatever up the files in a directory before building the docs.

Upvotes: 3

Related Questions