Skip to content

Commit

Permalink
Merge pull request #34 from sphinx-contrib/fix_link_to_files_pdf
Browse files Browse the repository at this point in the history
Fix links to files in Doxygen's PDF output
  • Loading branch information
JasperCraeghs authored Sep 10, 2021
2 parents 9852e59 + 1ae47d3 commit e7ca85a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
1.10 (Sep 10, 2021)
==================

- Fix links to files in Doxygen's PDF output [PR #33]

1.9 (Sep 02, 2021)
==================

Expand Down
2 changes: 1 addition & 1 deletion sphinxcontrib/doxylink/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '1.9'
__version__ = '1.10'


def setup(app):
Expand Down
3 changes: 2 additions & 1 deletion sphinxcontrib/doxylink/doxylink.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@ def find_doxygen_link(name, rawtext, text, lineno, inliner, options={}, content=
full_url = join(rootdir, url.file)
elif rootdir.endswith('.pdf'):
full_url = join(rootdir, '#', url.file)
full_url = full_url.replace('.html#', '_')
full_url = full_url.replace('.html#', '_') # for links to variables and functions
full_url = full_url.replace('.html', '') # for links to files
# But otherwise we need to add the relative path of the current document to the root source directory to the link
else:
relative_path_to_docsrc = os.path.relpath(app.env.srcdir, os.path.dirname(inliner.document.attributes['source']))
Expand Down

0 comments on commit e7ca85a

Please sign in to comment.