Skip to content

Commit ee6c82e

Browse files
docs raw
1 parent 125e77b commit ee6c82e

File tree

2 files changed

+96
-58
lines changed

2 files changed

+96
-58
lines changed

docs/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,3 +254,5 @@
254254
"sphinx": ("https://www.sphinx-doc.org/", None),
255255
"gitpython": ("https://gitpython.readthedocs.io/en/stable/", None),
256256
}
257+
258+
pygments_style = "github-dark"

docs/settings.rst

Lines changed: 94 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -10,63 +10,8 @@ Settings
1010
1111
The ``sphinx-versioned-docs`` reads options from two sources:
1212

13-
* From the sphinx ``conf.py`` file.
1413
* From the provided command-line-arguments.
15-
16-
Configuration File Arguments
17-
============================
18-
19-
.. option:: sv_project_url: <url>
20-
21-
Setting this variable will make sure that the ``Project home`` is listed on the versions selector badge/menu.
22-
23-
.. option:: sv_select_branch
24-
25-
Select any particular branches/tags to build.
26-
The branch/tag names can be separated by ``,`` or ``|``.
27-
28-
Selecting a branch will always take precedence over excluding one.
29-
30-
Example: ``sv_select_branch=["main", "v2.0"]``
31-
The option above will build ``main``, ``v2.0`` and will skip all others.
32-
33-
.. option:: sv_exclude_branch
34-
35-
Exclude any particular branches/tags from building workflow.
36-
The branch/tag names can be separated by ``,`` or ``|``.
37-
38-
Selecting a branch will always take precedence over excluding one.
39-
40-
Example: ``sv_exclude_branch=["v1.0"]``
41-
The option above will exclude ``v1.0`` and will build all others.
42-
43-
.. option:: sv_main_branch
44-
45-
Specify the main-branch to which the top-level ``index.html`` redirects to. Default is ``main``.
46-
47-
.. option:: sv_quite
48-
49-
Silents the output from `sphinx`. Use `--no-quite` to get complete-output from `sphinx`. Default is `True`.
50-
51-
.. option:: sv_verbose
52-
53-
Passed directly to sphinx. Specify more than once for more logging in sphinx. Default is `False`.
54-
55-
.. option:: sv_force_branches
56-
57-
Force branch selection. Use this option to build detached head/commits. Default is `False`.
58-
59-
.. option:: sv_floating_badge
60-
61-
Turns the version selector menu into a floating badge. Default is `False`.
62-
63-
.. option:: sv_reset_intersphinx
64-
65-
Resets intersphinx mapping; acts as a patch for issue `#17 <https://github.com/devanshshukla99/sphinx-versioned-docs/issues/17>`__. Default is `False`.
66-
67-
.. option:: sv_sphinx_compability
68-
69-
Adds compatibility for older sphinx versions by monkey patching certain functions. Default is `False`.
14+
* From the sphinx ``conf.py`` file.
7015

7116

7217
Command Line Arguments
@@ -111,6 +56,10 @@ These command line options must be specified when executing the ``sphinx-version
11156

11257
``sphinx-versioned --branch="main, -v*"``
11358

59+
.. note::
60+
61+
Selecting a branch will always take precedence over excluding one.
62+
11463
.. option:: -m <branch name>, --main-branch <branch name>
11564

11665
Specify the main-branch to which the top-level ``index.html`` redirects to. Default is ``main``.
@@ -121,10 +70,11 @@ These command line options must be specified when executing the ``sphinx-version
12170

12271
.. option:: --ignore-conf
12372

124-
Ignores conf.py configuration file arguments for sphinx-versioned-docs.
73+
Ignores ``conf.py`` configuration file arguments for ``sphinx-versioned-docs``.
12574

12675
.. warning::
127-
conf.py will still be used in sphinx!
76+
77+
``conf.py`` will still be used in sphinx!
12878

12979
.. option:: --quite, --no-quite
13080

@@ -146,3 +96,89 @@ These command line options must be specified when executing the ``sphinx-version
14696
.. option:: --help
14797

14898
Show the help message in command-line.
99+
100+
101+
Configuration File Arguments
102+
============================
103+
104+
.. warning::
105+
106+
Unfortunately, due to limitations of the current implementation, all path variables
107+
like git-path, output path, local ``conf.py`` path cannot be select
108+
via configuration file argument and must be specified in CLI arguments.
109+
110+
.. option:: sv_project_url: <url>
111+
112+
Setting this variable will make sure that the ``Project home`` is listed on the versions selector badge/menu.
113+
114+
.. option:: sv_select_branch
115+
116+
Select any particular branches/tags to build.
117+
118+
The branch/tag names can be specified in an array with names separated by ``,`` or ``|``.
119+
120+
Example: ``sv_select_branch=["main", "v2.0"]``
121+
122+
The option above will build ``main``, ``v2.0`` and will skip all others.
123+
124+
.. note::
125+
126+
Selecting a branch will always take precedence over excluding one.
127+
128+
.. option:: sv_exclude_branch
129+
130+
Exclude any particular branches/tags from building workflow.
131+
The branch/tag names can be specified in an array with names separated by ``,`` or ``|``.
132+
133+
Example: ``sv_exclude_branch=["v1.0"]``
134+
135+
The option above will exclude ``v1.0`` and will build all others.
136+
137+
.. option:: sv_main_branch
138+
139+
Specify the main-branch to which the top-level ``index.html`` redirects to. Default is ``main``.
140+
141+
.. option:: sv_verbose
142+
143+
Passed directly to sphinx. Specify more than once for more logging in sphinx. Default is `False`.
144+
145+
.. option:: sv_force_branch
146+
147+
Force branch selection. Use this option to build detached head/commits. Default is `False`.
148+
149+
.. option:: sv_floating_badge
150+
151+
Turns the version selector menu into a floating badge. Default is `False`.
152+
153+
.. option:: sv_reset_intersphinx
154+
155+
Resets intersphinx mapping; acts as a patch for issue `#17 <https://github.com/devanshshukla99/sphinx-versioned-docs/issues/17>`__. Default is `False`.
156+
157+
.. option:: sv_sphinx_compability
158+
159+
Adds compatibility for older sphinx versions by monkey patching certain functions. Default is `False`.
160+
161+
Template for ``conf.py``
162+
------------------------
163+
164+
.. code::
165+
166+
# conf.py
167+
# sphinx arguments
168+
# ...
169+
# ...
170+
171+
# sphinx-versioned-docs arguments
172+
# This template will have a project url for `sphinx-versioned-docs`
173+
# will exclude `v1.0` branch
174+
# will set `main` as the main branch
175+
# other options can be enabled, if and as requried.
176+
sv_project_url = "https://www.github.com/devanshshukla99/sphinx-versioned-docs"
177+
sv_select_branch = []
178+
sv_exclude_branch = ["-v1.0"]
179+
sv_main_branch = "main"
180+
sv_verbose = ""
181+
sv_force_branch = False
182+
sv_floating_badge = False
183+
sv_reset_intersphinx = False
184+
sv_sphinx_compability = False

0 commit comments

Comments
 (0)