Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c9ad057

Browse files
committed
Don't enable the sphinx_toolbox.github extension as part of the source extension, and alert users in the docs that it needs to be enabled manually to use the GitHub source option.
1 parent e7f4d29 commit c9ad057

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

‎doc-source/changelog.rst

+7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
Changelog
33
===============
44

5+
4.0.0
6+
----------------------
7+
8+
The :mod:`sphinx_toolbox.source` module no longer enables the :mod:`sphinx_toolbox.github` extension automatically.
9+
If you have :confval:`source_link_target` set to ``'GitHub'`` you may need to enable the extension manually.
10+
11+
512
3.10.0
613
----------------------
714

‎sphinx_toolbox/source.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
function signatures, checkout :mod:`sphinx.ext.linkcode` and :mod:`sphinx.ext.viewcode`.
1111
1212
13+
.. versionchanged:: 4.0.0
14+
15+
The :mod:`sphinx_toolbox.source` module no longer enables the :mod:`sphinx_toolbox.github` extension automatically.
16+
If you have :confval:`source_link_target` set to ``'GitHub'`` you may need to enable the extension manually.
17+
18+
1319
Usage
1420
-------
1521
@@ -21,6 +27,11 @@
2127
The target of the source link, either ``'GitHub'`` or ``'Sphinx'``.
2228
Case insensitive.
2329
30+
.. note::
31+
32+
The ``'GitHub'`` source option requires the :mod:`sphinx_toolbox.github` extension to be enabled in your ``conf.py`` file,
33+
and its :confval:`github_username` and :confval:`github_repository` options set.
34+
See that extension's documentation for more details.
2435
2536
.. rst:role:: source
2637
@@ -259,6 +270,6 @@ def setup(app: Sphinx) -> SphinxExtMetadata:
259270
app.add_config_value("source_link_target", "Sphinx", "env", types=[str])
260271
app.connect("config-inited", _configure)
261272

262-
app.setup_extension("sphinx_toolbox.github")
273+
# app.setup_extension("sphinx_toolbox.github")
263274

264275
return {"parallel_read_safe": True}

0 commit comments

Comments
 (0)