Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document settings for source code links #1635

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 33 additions & 2 deletions docs/configuring.rst
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,26 @@ Miscellaneous options
File-wide metadata
==================

The following options can be used as :ref:`file-wide metadata
<sphinx:metadata>`:
The following features are confugured per file in :ref:`file-wide metadata
<sphinx:metadata>`, but they could also be set for all files using
:ref:`html_context <spinx:html_context>` setting.

Enable "Edit on ..." links
--------------------------

To enable "Edit on GitHub" link, you can add ``github_url`` option to the
metadata of specific page, or use ``html_context`` to make this option set
for all pages.

For example:

.. code:: python

html_context = {
'github_url': 'https://github.com/readthedocs/sphinx_rtd_theme'
}

Note that such URLs are static.

.. confval:: github_url

Expand All @@ -236,6 +254,19 @@ The following options can be used as :ref:`file-wide metadata

Force the :guilabel:`Edit on GitLab` button to use the configured URL.

To generate dynamic URLs, there exists a set of other options.

.. code:: python

html_context = {
'display_github': True,
# 'github_host': 'github.com',
'github_user': 'readthedocs',
'github_repo': 'sphinx_rtd_theme',
'github_version': 'master/docs/'
}


Other configuration
===================

Expand Down