changeset 7492:452a8bd1d826

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[].
author John Rouillard <rouilj@ieee.org>
date Thu, 15 Jun 2023 20:46:59 -0400
parents b290c7b95986
children 06a2f79389b6
files doc/_templates/layout.html doc/conf.py website/www/conf.py website/www/requirements.pip
diffstat 4 files changed, 26 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/doc/_templates/layout.html	Thu Jun 15 15:16:43 2023 -0400
+++ b/doc/_templates/layout.html	Thu Jun 15 20:46:59 2023 -0400
@@ -73,14 +73,30 @@
 {%- endmacro %}
 
 {%- macro css() %}
-    <link rel="stylesheet" href="{{ pathto('_static/basic.css', 1) }}" type="text/css" />
-    <link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
+    <link rel="stylesheet" href="{{ pathto('_static/NO_basic.css', 1) }}" type="text/css" />
+    <link rel="stylesheet" href="{{ pathto('_static/' + styles[-1], 1) }}" type="text/css" />
     <link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
     {%- for cssfile in css_files %}
     <link rel="stylesheet" href="{{ pathto(cssfile, 1) }}" type="text/css" />
     {%- endfor %}
 {%- endmacro %}
 
+{#
+ In newer sphinx styles is an array and style does not exist
+ In older sphinx (1.x) style is the style set in conf.py.
+
+ If style exists, assume styles doesn't exist and make styles
+ exist with style as the only value.
+
+ So we can use styles[-1] in the css() macro.
+ When sourceforge lets me build docs with something newer than sphinx 1,
+ we can delete this.
+#}
+{% if style %}
+{% set styles = [] %}
+{{ styles.append( style ) }}
+{% endif %}
+
 <html lang="en">
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
--- a/doc/conf.py	Thu Jun 15 15:16:43 2023 -0400
+++ b/doc/conf.py	Thu Jun 15 20:46:59 2023 -0400
@@ -84,7 +84,7 @@
 #
 # This is also used if you do content translation via gettext catalogs.
 # Usually you set "language" from the command line for these cases.
-language = None
+language = 'en'
 
 # There are two options for replacing |today|: either, you set today to some
 # non-false value, then it is used:
@@ -117,6 +117,10 @@
 # The name of the Pygments (syntax highlighting) style to use.
 pygments_style = 'sphinx'
 
+# disable permalinks
+html_add_permalinks = ''
+html_permalinks = False  # when sphinx > 3.5 is used.
+
 # A list of ignored prefixes for module index sorting.
 #modindex_common_prefix = []
 
--- a/website/www/conf.py	Thu Jun 15 15:16:43 2023 -0400
+++ b/website/www/conf.py	Thu Jun 15 20:46:59 2023 -0400
@@ -168,7 +168,9 @@
 # template names.
 #html_additional_pages = {}
 
+# disable permalinks
 html_add_permalinks = ''
+html_permalinks = False  # when sphinx > 3.5 is used.
 
 # If false, no module index is generated.
 #html_use_modindex = True
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/website/www/requirements.pip	Thu Jun 15 20:46:59 2023 -0400
@@ -0,0 +1,1 @@
+sphinx_sitemap

Roundup Issue Tracker: http://roundup-tracker.org/