Hi, you may have noticed that we have an 'official' Debian-style html theme for Sphinx-based manuals on the Debian website now.
It can be seen at debian-policy under https://www.debian.org/doc/debian-policy/ It was created by Stéphane Blondon, based on a theme from readthedocs.org. Any objections against porting this theme to the release-notes as well? To make this theme work on the Debian website, there are some more changings needed in webmaster's cron repo; I have prepared them and attached to this mail, just for completeness. Holger -- Holger Wansing <hwans...@mailbox.org> PGP-Fingerprint: 496A C6E8 1442 4B34 8508 3529 59F1 87CA 156E B076
>From 2704fab5800f36aeafa29275e7afd13b422ecb81 Mon Sep 17 00:00:00 2001 From: Holger Wansing <hwans...@mailbox.org> Date: Sun, 14 Apr 2024 22:04:20 +0200 Subject: [PATCH] =?UTF-8?q?Switch=20to=20new=20Debian-style=20html=20theme?= =?UTF-8?q?=20by=20St=C3=A9phane=20Blondon,=20based=20on=20readthedocs.org?= =?UTF-8?q?=20theme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/_static/debian.css | 103 ++++++++++++++++++++++++++++++++++++++ source/conf.py | 14 +++--- 2 files changed, 109 insertions(+), 8 deletions(-) create mode 100644 source/_static/debian.css diff --git a/source/_static/debian.css b/source/_static/debian.css new file mode 100644 index 00000000..7f0981b0 --- /dev/null +++ b/source/_static/debian.css @@ -0,0 +1,103 @@ +/* Debian Cascading stylesheet for Sphinx */ + +div.related { + background-color: #C70036; +} + +.rst-content h1, .rst-content h2, .rst-content h3, .rst-content h4, .rst-content h5, .rst-content h6 { + color: #C70036; +} + +.wy-nav-top { + background-color: #C70036; +} + +.wy-side-nav-search { + background-color: #C70036; +} + +.rst-content a:link { + color: #0035C7; + text-decoration: none; +} +.rst-content a:visited { + color: #00207A; + text-decoration: none; +} +.rst-content a:link:hover { + color: #00207A; + text-decoration: underline; +} + + +/* Table in content */ + +.wy-table-responsive table td, .wy-table-responsive table th { + white-space: normal; +} + +.rst-content table.docutils, .wy-table-bordered-all { + width: 100%; +} + +.wy-table-responsive table.docutils thead tr { + background-color: #C70036; + border: 1px solid black; + color: black; +} + +.wy-table-responsive table.docutils thead tr:hover { + color: #fcfcfc; +} + +.wy-table-responsive table.docutils tbody tr:hover { + background-color:#666666; + color: #FFFFFF; +} + +.rst-content table.docutils:not(.field-list) tbody tr:hover:nth-child(2n-1), .wy-table-backed, .wy-table-odd td, .wy-table-striped tr:nth-child(2n-1) td { + background-color:#666666; +} + +/* Previous and next buttons */ + +.rst-footer-buttons .btn:hover { + text-decoration: none !important; +} + +/* Version release more readable */ + +.wy-side-nav-search > div.version { + color: #FCFCFC; +} + +/* Infos blocks */ + +div.warning { + border: 1px dashed #EFF500; + background-color: #eff50030; +} + +div.note { + border: 1px dashed blue; + background-color: #0000ff30; + +} + +.warning, .note { + margin-left: 1em; + margin-right: 1em; +} + +@media (max-width: 5in), (max-device-width: 5in){ + .warning, .note { + margin-left: 0.5em; + margin-right: 0.5em; + } +} + +/* Notes */ + +html.writer-html5 .rst-content aside.citation, html.writer-html5 .rst-content aside.footnote, html.writer-html5 .rst-content div.citation { + display: block; +} diff --git a/source/conf.py b/source/conf.py index 855fb942..ec055233 100644 --- a/source/conf.py +++ b/source/conf.py @@ -127,20 +127,15 @@ pygments_style = None # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'alabaster' +html_theme = 'sphinx_rtd_theme' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. # html_theme_options = { - 'logo': 'openlogo-release-notes.png', - 'show_powered_by': False, - 'link': '#0035c7', - 'sidebar_header': '#c70036', - 'sidebar_link': '#0035c7', - 'show_related': True, - 'show_relbars': True + # To get previous/next buttons at the top and the bottom: + 'prev_next_buttons_location': 'both' } # Add any paths that contain custom static files (such as style sheets) here, @@ -148,6 +143,9 @@ html_theme_options = { # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] +# Overwrite theme to fit Debian colors +html_css_files = ['debian.css'] + html_js_files = ['switchers.js'] # Hide âCreated using Sphinxâ in the HTML footer -- 2.39.2
diff --git a/parts/7release-notes b/parts/7release-notes index c1a74c9..a700b71 100755 --- a/parts/7release-notes +++ b/parts/7release-notes @@ -122,6 +122,8 @@ for page in $pagepattern; do if [ "$(basename $page .$lang.html)" = "$(basename $page)" ]; then # This is not *.$lang.html file but *.html pagecopy $lang "$pagefile" "$destdir/$(basename $page .html).$lang.html" + # Correct links to search page - use language-specific file instead of en + sed -i s/search.html/search.$lang.html/ "$destdir/$(basename $page .html).$lang.html" if [ "$lang" = "en" ]; then ln -sf "$(basename $page .html).en.html" "$destdir/$(basename $page)" fi @@ -138,6 +140,14 @@ for page in $pagepattern; do fi done +if [ "$lang" != "en" ]; then + if [ -f "$basedir/searchindex.js" ]; then + # Copy language-specific search index and point $lang search page to it + install -p -m 664 $basedir/searchindex.js $destdir/searchindex.$lang.js + sed -i s/searchindex.js/searchindex.$lang.js/ $destdir/search.$lang.html + fi +fi + if [ "$lang" = "en" ]; then pagepattern="$basedir/_static/*" for page in $pagepattern; do @@ -160,6 +170,30 @@ if [ "$lang" = "en" ]; then install -p -m 664 `readlink -f $page` $destdir/_sources/$(basename $page) fi done + pagepattern="$crondir/tmp_rtd-html-theme/sphinx_rtd_theme/static/css/*" + for page in $pagepattern; do + if [ -f "`readlink -f $page`" ]; then + mkdirp $destdir/_static/css + install -p -m 664 `readlink -f $page` $destdir/_static/css/$(basename $page) + fi + done + pagepattern="$crondir/tmp_rtd-html-theme/sphinx_rtd_theme/static/fonts/*" + for page in $pagepattern; do + if [ -f "`readlink -f $page`" ]; then + mkdirp $destdir/_static/fonts + install -p -m 664 `readlink -f $page` $destdir/_static/fonts/$(basename $page) + fi + done + pagepattern="$crondir/tmp_rtd-html-theme/sphinx_rtd_theme/static/js/*" + for page in $pagepattern; do + if [ -f "`readlink -f $page`" ]; then + mkdirp $destdir/_static/js + install -p -m 664 `readlink -f $page` $destdir/_static/js/$(basename $page) + fi + done + if [ -f "$basedir/searchindex.js" ]; then + install -p -m 664 $basedir/searchindex.js $destdir + fi fi }