Skip to content
Snippets Groups Projects

Fix the edit link for API documentation

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

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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • added 1 commit

    • 121d7ab0 - Fix the edit link for API documentation

    Compare with previous version

  • I'm surprised that there's still no spaceless filter for jinja2 and we need to resort to hax :-)

  • Nicolas Dandrimont approved this merge request

    approved this merge request

  • Jérémy Bobbio (Lunar) resolved all threads

    resolved all threads

  • Jenkins job DDOC/builds #80 succeeded .
    See Console Output and Coverage Report for more details.

  • added 1 commit

    • af594297 - Fix the edit link for API documentation

    Compare with previous version

  • Jenkins job DDOC/builds #81 succeeded .
    See Console Output and Coverage Report for more details.

  • Jenkins job DDOC/builds #82 succeeded .
    See Console Output and Coverage Report for more details.

  • Please register or sign in to reply
    Loading