ProjectPythia / sphinx-pythia-theme

A Sphinx theme for Project Pythia
https://sphinx-pythia-theme.readthedocs.io
Apache License 2.0
3 stars 6 forks source link

Fixes for links and documentation #31

Closed kmpaul closed 2 years ago

kmpaul commented 2 years ago

This PR fixes some incorrect links generated throughout the document and implements a more robust mechanism for getting the links correct on every page. Use of relative URLs doesn't work when some pages are in deeper directories, and use of absolute URLs doesn't work when the web host places the HTML site in a deeper hierarchy (e.g., as readthedocs does, placing the HTML directory in a subdirectory like /{loc}/{build}/ where {loc} is the locale language and {build} is the RTD build version). The fix for this is to use Sphinx's builtin pathto(docname) function to find the path to a document with the name docname from the page the link is being generated on! Thus, the actual HTML href for the link will be custom built for each page. (Obviously, this requires fixing the templates to look for docnames, too!)