Skip to content

Fix the edit link for API documentation

Jérémy Bobbio (Lunar) requested to merge fix-edit-link-for-api into master

The swh-docs building process symlinks the documentation for individual modules into the swh-docs tree to generate a single Sphinx project. The “Edit this page” link therefore needs to point to the right repository on GitLab in these case.

We try to implement this using the edit_page_url_template option of the PyData theme, see: https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/source-buttons.html#custom-edit-url

We can take advantage that it’s a Jinja2 template to recognize that API documentation file path starts with devel/swh- and adjust accordingly. This is a bit of a hack, but we can hope it’ll be enough as long as we stay consistent.

Merge request reports