-
Notifications
You must be signed in to change notification settings - Fork 208
Description
Description
We currently only support GitHub repositories for "repository link" as well as "edit this page". We should support a few of the more common ones as well, such as bitbucket and gitlab.
Here are major repository-specific features we'd want to implement:
- Repository link / issues link
- Edit this page link
- Launch buttons link
Benefit
This would make these theme features usable for people that use these other (quite popular) platforms!
Implementation details
Repository link
For the repository link, here's our code (and likely where a fix would be):
Edit this page link
We seem to be using the PyData Sphinx Theme get_edit_url function for this already, so we should figure out how to make it support non-GitHub repositories:
sphinx-book-theme/sphinx_book_theme/topbar/repobuttons.html
Lines 15 to 18 in 39aaaa3
| {% if theme_use_edit_page_button %}<a class="edit-button" href="{{ get_edit_url() }}"><button | |
| type="button" class="btn btn-secondary topbarbtn" data-toggle="tooltip" data-placement="left" | |
| title="{{ translate('Edit this page') }}"><i class="fas fa-pencil-alt"></i>{{ translate('suggest edit') }}</button></a>{% endif %} | |
| </div> |
here's the PyData theme function for this:
launch buttons
Here's the templating for our launch buttons:
And the Python logic that handles how we build these buttons:
https://github.com/executablebooks/sphinx-book-theme/blob/master/sphinx_book_theme/launch.py
Maybe we can re-use the get_edit_url for this somehow as well.
This would require changes here and here.
In particular raw git remotes should cover a lot of use cases.