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):
https://github.com/executablebooks/sphinx-book-theme/blob/master/sphinx_book_theme/topbar/repobuttons.html
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:
|
{% 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:
https://github.com/pydata/pydata-sphinx-theme/blob/055ae27cdc6801d6abba0c43bfa9cfd3a359e1b9/pydata_sphinx_theme/__init__.py#L481
launch buttons
Here's the templating for our launch buttons:
https://github.com/executablebooks/sphinx-book-theme/blob/master/sphinx_book_theme/topbar/launchbuttons.html
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.
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:
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):
https://github.com/executablebooks/sphinx-book-theme/blob/master/sphinx_book_theme/topbar/repobuttons.html
Edit this page link
We seem to be using the PyData Sphinx Theme
get_edit_urlfunction 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
here's the PyData theme function for this:
https://github.com/pydata/pydata-sphinx-theme/blob/055ae27cdc6801d6abba0c43bfa9cfd3a359e1b9/pydata_sphinx_theme/__init__.py#L481
launch buttons
Here's the templating for our launch buttons:
https://github.com/executablebooks/sphinx-book-theme/blob/master/sphinx_book_theme/topbar/launchbuttons.html
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_urlfor this somehow as well.This would require changes here and here.
In particular raw git remotes should cover a lot of use cases.