download files included multiple times in build

Kevin Horn avatarKevin Horn created an issue

If there are multiple :download: directives in source, which point to the same file but use different paths (because the directives are in different places in the source tree), the file will be included multiple times.

For example, if you have a project structure like this:

  • /conf.py
  • /index.rst
  • /examples/testfile.py
  • /examples/index.rst

and index.rst contains:

:download:`/examples/testfile.py`

and examples/index.rst contains:

:download:`testfile.py`

then tesfile.py will be included in the _downloads directory twice. Once as 'testfile.py', and once as 'testfile1.py'.

I think the file should only be included once in the case where the directives are pointing to the same file.

Comments (4)

  1. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.