You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TL;DR: How can I set different GitHub URLs relative and specific to toc chapters / directories.
Or a step back: What is the best way to combine multiple sphinx documentations from different repositories into one single project.
Context
I have multiple sphinx documentations for different projects across separate GitHub repositories.
I want to create one main project where all other projects are included for easier navigation, searchability across projects, etc.
For this I created a new sphinx project, copied the other projects into subdirectories and included them via a new root TOC. This works nicely.
Problem: "Edit on GitHub"
Documentation
First of all I think this feature is missing from the rtd theme documentation.
Only github_url is mentioned.
The more useful approach is only documented in the readthedocs service documentation.
Solutions
I thought about different solutions,
The sphinx meta data solution :github_url: <url> needs to be defined in every file to redirect to the correct repository. This variable does not use branches, file names, ... Therefore one would have to define the unique URL in every file.
Using html_context with github_user, github_host etc. creates the URLs dynamically (that is with the configured branch, the actual file name and so on). But html_context is global, I can not use different hosts or branches from separate repositories.
Writing a custom extension. Somehow modifying each file during the build process as necessary.
It seems like I can not avoid customizing sphinx / the theme for this usecase. What do you think?
The text was updated successfully, but these errors were encountered:
TL;DR: How can I set different GitHub URLs relative and specific to toc chapters / directories.
Or a step back: What is the best way to combine multiple sphinx documentations from different repositories into one single project.
Context
I have multiple sphinx documentations for different projects across separate GitHub repositories.
I want to create one main project where all other projects are included for easier navigation, searchability across projects, etc.
For this I created a new sphinx project, copied the other projects into subdirectories and included them via a new root TOC. This works nicely.
Problem: "Edit on GitHub"
Documentation
First of all I think this feature is missing from the rtd theme documentation.
Only github_url is mentioned.
The more useful approach is only documented in the readthedocs service documentation.
Solutions
I thought about different solutions,
:github_url: <url>
needs to be defined in every file to redirect to the correct repository. This variable does not use branches, file names, ... Therefore one would have to define the unique URL in every file.html_context
withgithub_user
,github_host
etc. creates the URLs dynamically (that is with the configured branch, the actual file name and so on). Buthtml_context
is global, I can not use different hosts or branches from separate repositories.It seems like I can not avoid customizing sphinx / the theme for this usecase. What do you think?
The text was updated successfully, but these errors were encountered: