Skip to content

Commit 74e60ea

Browse files
committed
add file with sphinx requirements for building doc.
Disable permalinks for older and newer sphinx versions. make conf.py's work with old and new sphinx. make layout.py work with 7.x sphinx which replaces the style variable with styles[].
1 parent 03c09ff commit 74e60ea

File tree

4 files changed

+26
-3
lines changed

4 files changed

+26
-3
lines changed

doc/_templates/layout.html

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,30 @@ <h3>{{ _('Quick search') }}</h3>
7373
{%- endmacro %}
7474

7575
{%- macro css() %}
76-
<link rel="stylesheet" href="{{ pathto('_static/basic.css', 1) }}" type="text/css" />
77-
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
76+
<link rel="stylesheet" href="{{ pathto('_static/NO_basic.css', 1) }}" type="text/css" />
77+
<link rel="stylesheet" href="{{ pathto('_static/' + styles[-1], 1) }}" type="text/css" />
7878
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
7979
{%- for cssfile in css_files %}
8080
<link rel="stylesheet" href="{{ pathto(cssfile, 1) }}" type="text/css" />
8181
{%- endfor %}
8282
{%- endmacro %}
8383

84+
{#
85+
In newer sphinx styles is an array and style does not exist
86+
In older sphinx (1.x) style is the style set in conf.py.
87+
88+
If style exists, assume styles doesn't exist and make styles
89+
exist with style as the only value.
90+
91+
So we can use styles[-1] in the css() macro.
92+
When sourceforge lets me build docs with something newer than sphinx 1,
93+
we can delete this.
94+
#}
95+
{% if style %}
96+
{% set styles = [] %}
97+
{{ styles.append( style ) }}
98+
{% endif %}
99+
84100
<html lang="en">
85101
<head>
86102
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

doc/conf.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
#
8585
# This is also used if you do content translation via gettext catalogs.
8686
# Usually you set "language" from the command line for these cases.
87-
language = None
87+
language = 'en'
8888

8989
# There are two options for replacing |today|: either, you set today to some
9090
# non-false value, then it is used:
@@ -117,6 +117,10 @@
117117
# The name of the Pygments (syntax highlighting) style to use.
118118
pygments_style = 'sphinx'
119119

120+
# disable permalinks
121+
html_add_permalinks = ''
122+
html_permalinks = False # when sphinx > 3.5 is used.
123+
120124
# A list of ignored prefixes for module index sorting.
121125
#modindex_common_prefix = []
122126

website/www/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@
168168
# template names.
169169
#html_additional_pages = {}
170170

171+
# disable permalinks
171172
html_add_permalinks = ''
173+
html_permalinks = False # when sphinx > 3.5 is used.
172174

173175
# If false, no module index is generated.
174176
#html_use_modindex = True

website/www/requirements.pip

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sphinx_sitemap

0 commit comments

Comments
 (0)