Mercurial > p > roundup > code
comparison doc/_templates/layout.html @ 8572:63665d93940b
doc: reconcile and make build_doc work for sphinx-9
Building docs using setup.py build_doc failed with sphinx 9.x.
However building in website/www works.
Try to bring layout.html for doc closer to www. Also update conf.py to
make them closer. They are a little different because website has
additional functionality, but try to make them closer.
This commit works with sphinx 7, 8 and 9.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Tue, 14 Apr 2026 13:39:39 -0400 |
| parents | 7ac637506acf |
| children |
comparison
equal
deleted
inserted
replaced
| 8571:ae1d77e99ad6 | 8572:63665d93940b |
|---|---|
| 9 ~~~~~~~~~~~~~~~~~~~~~~ | 9 ~~~~~~~~~~~~~~~~~~~~~~ |
| 10 | 10 |
| 11 Custom layout template for Roundup. | 11 Custom layout template for Roundup. |
| 12 | 12 |
| 13 #} | 13 #} |
| 14 {%- block doctype -%} | |
| 15 <!DOCTYPE html> | |
| 16 {%- endblock %} | |
| 17 {%- macro relbar(class) %} | 14 {%- macro relbar(class) %} |
| 18 <div class="related {{ class }}"> | 15 <div class="related {{ class }}"> |
| 19 <ul> | 16 <ul> |
| 20 {%- for rellink in rellinks %} | 17 {%- for rellink in rellinks %} |
| 21 <li class="right" {% if loop.first %}style="margin-right: 10px"{% endif %}> | 18 <li class="right" {% if loop.first %}style="margin-right: 10px"{% endif %}> |
| 76 <script type="text/javascript">$('#searchbox').show(0);</script> | 73 <script type="text/javascript">$('#searchbox').show(0);</script> |
| 77 {%- endif %} | 74 {%- endif %} |
| 78 {%- endblock %} | 75 {%- endblock %} |
| 79 {%- endmacro %} | 76 {%- endmacro %} |
| 80 | 77 |
| 81 {%- macro css() %} | |
| 82 <link rel="stylesheet" href="{{ pathto('_static/NO_basic.css', 1) }}" type="text/css" /> | |
| 83 <link rel="stylesheet" href="{{ pathto('_static/' + styles[-1], 1) }}" type="text/css" /> | |
| 84 <link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" /> | |
| 85 {%- for cssfile in css_files %} | |
| 86 <link rel="stylesheet" href="{{ pathto(cssfile, 1) }}" type="text/css" /> | |
| 87 {%- endfor %} | |
| 88 {%- endmacro %} | |
| 89 | 78 |
| 90 {# | 79 <!DOCTYPE html> |
| 91 In newer sphinx styles is an array and style does not exist | |
| 92 In older sphinx (1.x) style is the style set in conf.py. | |
| 93 | |
| 94 If style exists, assume styles doesn't exist and make styles | |
| 95 exist with style as the only value. | |
| 96 | |
| 97 So we can use styles[-1] in the css() macro. | |
| 98 When sourceforge lets me build docs with something newer than sphinx 1, | |
| 99 we can delete this. | |
| 100 #} | |
| 101 {% if style %} | |
| 102 {% set styles = [] %} | |
| 103 {{ styles.append( style ) }} | |
| 104 {% endif %} | |
| 105 | |
| 106 <html lang="en"> | 80 <html lang="en"> |
| 107 <head> | 81 <head> |
| 108 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | 82 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 109 <meta name="viewport" content="width=device-width, initial-scale=1"> | 83 <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 110 {%- if builder != 'htmlhelp' %} | 84 {%- if builder != 'htmlhelp' %} |
| 111 {%- set titlesuffix = " — "|safe + docstitle|e %} | 85 {%- set titlesuffix = docstitle|e %} |
| 86 {%- set titlesuffix = " - " + titlesuffix %} | |
| 112 {%- endif %} | 87 {%- endif %} |
| 113 <title>{{ title|striptags }}{{ titlesuffix }}</title> | 88 <title>{{ title|striptags }}{{ titlesuffix }}</title> |
| 89 | |
| 114 {%- if builder != 'htmlhelp' %} | 90 {%- if builder != 'htmlhelp' %} |
| 115 <script type="text/javascript"> | 91 <script type="text/javascript"> |
| 116 var DOCUMENTATION_OPTIONS = { | 92 var DOCUMENTATION_OPTIONS = { |
| 117 URL_ROOT: '{{ pathto("", 1) }}', | 93 URL_ROOT: '{{ pathto("", 1) }}', |
| 118 VERSION: '{{ release|e }}', | 94 VERSION: '{{ release|e }}', |
| 121 }; | 97 }; |
| 122 </script> | 98 </script> |
| 123 {%- for scriptfile in script_files %} | 99 {%- for scriptfile in script_files %} |
| 124 <script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script> | 100 <script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script> |
| 125 {%- endfor %} | 101 {%- endfor %} |
| 102 | |
| 126 {%- if builder == 'web' %} | 103 {%- if builder == 'web' %} |
| 127 <link rel="stylesheet" href="{{ pathto('index') }}?do=stylesheet{% | 104 <link rel="stylesheet" href="{{ pathto('index') }}?do=stylesheet{% |
| 128 if in_admin_panel %}&admin=yes{% endif %}" type="text/css" /> | 105 if in_admin_panel %}&admin=yes{% endif %}" type="text/css" /> |
| 129 {%- for link, type, title in page_links %} | 106 {%- for link, type, title in page_links %} |
| 130 <link rel="alternate" type="{{ type|e(true) }}" title="{{ title|e(true) }}" href="{{ link|e(true) }}" /> | 107 <link rel="alternate" type="{{ type|e(true) }}" title="{{ title|e(true) }}" href="{{ link|e(true) }}" /> |
| 131 {%- endfor %} | 108 {%- endfor %} |
| 132 {%- else %} | 109 {%- else %} |
| 133 {{ css() }} | 110 <link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" /> |
| 111 <link rel="stylesheet" href="{{ pathto('_static/style.css', 1) }}" type="text/css" /> | |
| 134 {%- endif %} | 112 {%- endif %} |
| 135 <!-- https://github.com/sphinx-doc/sphinx/issues/11699 means a | 113 <!-- https://github.com/sphinx-doc/sphinx/issues/11699 means a |
| 136 duplicate viewport tag --> | 114 duplicate viewport tag --> |
| 137 {{ metatags }} | 115 {{ metatags }} |
| 138 {%- if 'name="description"' not in metatags %} | 116 {%- if 'name="description"' not in metatags %} |
| 169 {%- endif %} | 147 {%- endif %} |
| 170 {%- endblock %} | 148 {%- endblock %} |
| 171 {%- block extrahead %} {% endblock %} | 149 {%- block extrahead %} {% endblock %} |
| 172 </head> | 150 </head> |
| 173 <body> | 151 <body> |
| 174 <div class="header"><div class="label">Roundup</div> | 152 <header class="header"> |
| 153 <div class="label non_mobile">Roundup</div> | |
| 175 {%- if pagename != "search" %} | 154 {%- if pagename != "search" %} |
| 176 <script id="documentation_options" data-url_root="{{ url_root }}" | 155 <script id="documentation_options" data-url_root="{{ url_root }}" |
| 177 src="{{ pathto('_static/documentation_options.js', 1) }}"> | 156 src="{{ pathto('_static/documentation_options.js', 1) }}"> |
| 178 </script> | 157 </script> |
| 179 | 158 |
| 185 <input type="hidden" name="area" value="default" /> | 164 <input type="hidden" name="area" value="default" /> |
| 186 </form> | 165 </form> |
| 187 </div> | 166 </div> |
| 188 <script type="text/javascript">$('#searchbox').show(0);</script> | 167 <script type="text/javascript">$('#searchbox').show(0);</script> |
| 189 {%- endif %} | 168 {%- endif %} |
| 190 </div> | 169 </header> |
| 191 <div class="navigation"> | 170 <div class="navigation"> |
| 171 <nav aria-label="primary navigation"> | |
| 192 <div class="menu"> | 172 <div class="menu"> |
| 193 {{ sidebar() }} | 173 {{ sidebar() }} |
| 194 </div> | 174 </div> |
| 175 </nav> | |
| 195 </div> | 176 </div> |
| 196 {%- block content %} | 177 {%- block content %} |
| 197 <main id="main" role="main" class="content"> | 178 <main id="main" role="main" class="content"> |
| 198 {{ relbar('related-top') }} | 179 {{ relbar('related-top') }} |
| 199 {% block body %} {% endblock %} | 180 {% block body %} {% endblock %} |
| 200 {{ relbar('related-bottom') }} | 181 {{ relbar('related-bottom') }} |
| 201 </main> | 182 </main> |
| 202 {%- endblock %} | 183 {%- endblock %} |
| 203 {%- block footer %} | 184 {%- block footer %} |
| 204 <div class="footer"> | 185 <footer class="footer"> |
| 205 {%- if hasdoc('copyright') %} | 186 {%- if hasdoc('copyright') %} |
| 206 {% trans path=pathto('copyright'), copyright=copyright|e %}© <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %} | 187 {% trans path=pathto('copyright'), copyright=copyright|e %}© <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %} |
| 207 {%- else %} | 188 {%- else %} |
| 208 {% trans copyright=copyright|e %}© Copyright {{ copyright }}.{% endtrans %} | 189 {% trans copyright=copyright|e %}© Copyright {{ copyright }}.{% endtrans %} |
| 209 {%- endif %} | 190 {%- endif %} |
| 210 </div> | 191 </footer> |
| 211 {%- endblock %} | 192 {%- endblock %} |
| 212 </body> | 193 </body> |
| 213 </html> | 194 </html> |
