-
Notifications
You must be signed in to change notification settings - Fork 352
Open
Labels
help wantedExtra attention is neededExtra attention is neededkind: enhancementNew feature or requestNew feature or request
Description
The vispy library uses the sphinxcontrib.apidoc extension to automatically generate our API documents at build time. These generated files just use apidoc/autodoc tools to pull the information from the python package's source code. The issue with this is that the default "Edit this page" link in the pydata-sphinx-theme points to where the API doc file would be if it was committed to the repository. Since they aren't you get a 404.
I've hacked something together that seems to work, but wondering if anyone here had suggestions to make it better using either smarter jinja2 tips or features in the theme that I'm not aware of. You can find all the details here: vispy/vispy#2220
But the main context changes make it pretty obvious what I'm doing:
html_context = {
"github_user": "vispy",
"github_repo": "vispy",
"github_version": "main",
"doc_path": "doc",
"edit_page_url_template": "{{ vispy_custom_edit_url(github_user, github_repo, github_version, doc_path, file_name, default_edit_page_url_template) }}",
"default_edit_page_url_template": "https://github.com/{github_user}/{github_repo}/edit/{github_version}/{doc_path}{file_name}",
"vispy_custom_edit_url": _custom_edit_url,
}
12rambau and vivodivivodivivodivivodivivodivivodi
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is neededkind: enhancementNew feature or requestNew feature or request