mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
doc/dev: Set new theme for developer documentation
- Change theme to 'Book' based on Sphinx pydata theme. It supports dark/light modes. Looks more modern and better defaults/options. - Add logo on the top left corner. - Add menu to go to repository, view page source, edit page source, and report issue on current page. - Don't repeat 'FreedomBox Authors' in authors text and copyright text. Show only once as suggested by the theme. - Use theme option to show license link instead of overriding the template. Tests: - After building the theme, all options work as expected. - Footer appears as expected. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
4 files changed
+137
-21
No files matched your search
@@ -19,6 +19,7 @@ Install the following Debian packages:
|
||||
|
||||
* python3-sphinx
|
||||
* python3-sphinx-autobuild
|
||||
* python3-sphinx-book-theme
|
||||
* python3-django
|
||||
* python3-django-axes
|
||||
* python3-django-captcha
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="1500"
|
||||
height="1115"
|
||||
id="svg14507"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.2 r9819"
|
||||
sodipodi:docname="New document 12">
|
||||
<defs
|
||||
id="defs14509">
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient10958-4"
|
||||
id="linearGradient14441"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(-1834.4685,224.95153)"
|
||||
x1="2677.0659"
|
||||
y1="-1001.1581"
|
||||
x2="2677.0659"
|
||||
y2="-1126.5048" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient10958-4">
|
||||
<stop
|
||||
style="stop-color:#646464;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop10960-1" />
|
||||
<stop
|
||||
style="stop-color:#969696;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop10962-1" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient12651"
|
||||
id="radialGradient14443"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(-7.2244231,7.2244502,-7.2148432,-7.214843,5889.8349,216.70132)"
|
||||
cx="245.80219"
|
||||
cy="466.2821"
|
||||
fx="245.80219"
|
||||
fy="466.2821"
|
||||
r="34.49239" />
|
||||
<linearGradient
|
||||
id="linearGradient12651">
|
||||
<stop
|
||||
id="stop12653"
|
||||
offset="0"
|
||||
style="stop-color:#61a6ed;stop-opacity:1" />
|
||||
<stop
|
||||
id="stop12657"
|
||||
offset="1"
|
||||
style="stop-color:#257edb;stop-opacity:1" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.35"
|
||||
inkscape:cx="1545"
|
||||
inkscape:cy="366.07139"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
inkscape:window-width="1680"
|
||||
inkscape:window-height="1026"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="24"
|
||||
inkscape:window-maximized="1" />
|
||||
<metadata
|
||||
id="metadata14512">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(1170,216.56643)">
|
||||
<g
|
||||
id="g13562"
|
||||
transform="translate(-1172.219,1449.2669)">
|
||||
<path
|
||||
id="path4916-7"
|
||||
d="m 278.65647,-904.64231 c -10.2778,-0.045 -23.6656,0.4709 -35.25,11.5938 -4.6256,4.442 -6.3437,12.185 -6.3438,18.8125 l 0,70.9063 c 0,2.0698 0.7126,3.8054 2.125,5.2187 1.4145,1.3631 3.1251,2.0625 5.0938,2.0625 l 14.2188,0 c 1.9686,0 3.6372,-0.6994 5,-2.0625 1.4133,-1.4133 2.125,-3.149 2.125,-5.2187 l 0,-31.8126 48.625,0 c 1.9686,0 3.6049,-0.6681 4.9687,-2.0312 1.4124,-1.4134 2.125,-3.0938 2.125,-5.0625 l 0,-7.2187 c 0,-1.9181 -0.7126,-3.5551 -2.125,-4.9688 -1.3638,-1.4134 -3.0001,-2.1249 -4.9687,-2.125 l -48.625,0 0,-14.4688 c -0.3417,-11.6702 7.8265,-12.1874 12.6874,-12.1874 l 48.1876,0 c 1.9686,10e-5 3.6372,-0.6684 5,-2.0313 1.4133,-1.4134 2.125,-3.1249 2.125,-5.0937 l 0,-7.125 c 0,-1.9687 -0.7116,-3.649 -2.125,-5.0626 -1.3628,-1.4133 -3.0314,-2.1248 -5,-2.125 l -43.625,0 c -1.3272,0 -2.7505,0.01 -4.2188,0 z m 394.0312,0 c -1.3125,2e-4 -2.4039,0.4665 -3.3124,1.375 -0.8583,0.8583 -1.2814,1.9497 -1.2813,3.3126 l 0,23.25 c -8.1779,-2.5745 -15.4953,-3.8437 -21.9063,-3.8438 -12.4181,10e-5 -22.3173,3.7045 -29.6874,11.125 -7.3197,7.3702 -10.9688,17.993 -10.9688,31.875 0,13.8316 3.5265,24.4544 10.5938,31.875 7.1177,7.4206 15.9495,11.125 26.5,11.125 10.5503,0 19.8365,-2.8149 27.8124,-8.4688 l 0,2.3438 c 0,1.3125 0.4231,2.4351 1.2813,3.3438 0.8581,0.8581 1.9495,1.2812 3.3125,1.2812 l 14.5625,0 c 1.3629,0 2.4542,-0.4231 3.3125,-1.2812 0.9086,-0.9087 1.3749,-2.0313 1.375,-3.3438 l 0,-99.2812 c -10e-5,-1.3629 -0.4664,-2.4543 -1.375,-3.3126 -0.8583,-0.9085 -1.9496,-1.3748 -3.3125,-1.375 z m 297,0 c -1.9687,2e-4 -3.6803,0.7117 -5.0937,2.125 -1.4135,1.4136 -2.125,3.0939 -2.125,5.0626 l 0,94.2812 c 0,1.9687 0.7115,3.6491 2.125,5.0625 1.4134,1.363 3.125,2.0625 5.0937,2.0625 l 65.09383,0 c 11.257,0 20.7452,-2.8462 28.4688,-8.5 7.7738,-5.7043 11.6873,-14.0145 11.6874,-24.9688 -10e-5,-10.9541 -4.8703,-19.0504 -14.5624,-24.25 6.8147,-5.5527 10.2186,-12.0168 10.2187,-19.4374 -10e-5,-7.4711 -1.9809,-13.6106 -5.9687,-18.4063 -7.1684,-8.6825 -18.3128,-13.0311 -33.4063,-13.0313 z m 21.3438,20.5313 40.50003,0 c 3.1802,10e-5 5.7379,0.9568 7.6562,2.875 1.9182,1.9183 2.875,4.5987 2.875,8.0313 0,3.3822 -0.9568,6.0193 -2.875,7.9374 -1.9183,1.8679 -4.476,2.8126 -7.6562,2.8126 l -40.50003,0 z m -591.625,3.5625 c -7.7236,10e-5 -13.9857,0.9015 -18.7812,2.7188 -4.7452,1.7668 -9.6948,4.5145 -14.8438,8.25 l 0,-4.7813 c 0,-1.3629 -0.4231,-2.4543 -1.2812,-3.3125 -0.8582,-0.9086 -1.9809,-1.3749 -3.3438,-1.375 l -16.9688,0 c -1.3125,10e-5 -2.4038,0.4664 -3.3124,1.375 -0.8582,0.8582 -1.2813,1.9496 -1.2813,3.3125 l 0,73.6875 c 0,1.363 0.4231,2.4856 1.2813,3.3438 0.8581,0.8581 1.9495,1.2812 3.3124,1.2812 l 16.9688,0 c 1.3125,0 2.3918,-0.4231 3.25,-1.2812 0.9086,-0.8582 1.375,-1.9808 1.375,-3.3438 l 0,-48.375 c 6.209,-7.471 12.7164,-11.2187 19.5312,-11.2188 l 11.6563,0.4376 2.4375,0 c 1.3629,0 2.4855,-0.4231 3.3438,-1.2813 0.9085,-0.8581 1.3436,-1.9495 1.3437,-3.3125 l 0,-11.5312 c -1e-4,-1.3125 -0.4352,-2.3918 -1.3437,-3.25 -0.8583,-0.9086 -1.9809,-1.3437 -3.3438,-1.3438 z m 52.5625,0 c -13.8821,10e-5 -24.7381,3.7165 -32.5625,11.1875 -7.8245,7.4207 -11.7188,18.0867 -11.7188,31.9687 0,13.8317 3.8823,24.4112 11.6563,31.7813 7.7739,7.3701 18.6299,11.0625 32.5625,11.0625 27.6127,0.05 41.4062,-7.1684 41.4062,-21.6562 0,-1.363 -0.4351,-2.4544 -1.3437,-3.3126 -0.8583,-0.9086 -1.9809,-1.3749 -3.3437,-1.375 l -11.2813,0 c -3.6347,0.051 -6.6828,1.5963 -9.1563,4.625 -2.4735,3.0289 -7.0674,4.5313 -13.7812,4.5313 -6.7139,0 -11.6082,-1.4231 -14.6875,-4.25 -3.0289,-2.8269 -4.8077,-7.3221 -5.3125,-13.5313 l 57.0312,0 c 1.3629,10e-5 2.4543,-0.423 3.3126,-1.2812 0.9085,-0.9086 1.3749,-2.0745 1.375,-3.4375 l 0,-4.3125 c -10e-5,-13.5287 -3.8824,-23.9062 -11.6563,-31.125 -7.774,-7.2691 -18.618,-10.8749 -32.5,-10.875 z m 98.5,0 c -13.8821,10e-5 -24.7381,3.7165 -32.5625,11.1875 -7.8245,7.4207 -11.7188,18.0867 -11.7188,31.9687 0,13.8317 3.8823,24.4112 11.6563,31.7813 7.7739,7.3701 18.6299,11.0625 32.5625,11.0625 27.6127,0.05 41.4062,-7.1684 41.4062,-21.6562 0,-1.363 -0.4664,-2.4544 -1.375,-3.3126 -0.8582,-0.9086 -1.9496,-1.3749 -3.3124,-1.375 l -11.2813,0 c -3.6347,0.051 -6.6828,1.5963 -9.1563,4.625 -2.4735,3.0289 -7.0674,4.5313 -13.7812,4.5313 -6.7139,0 -11.6395,-1.4231 -14.7188,-4.25 -3.0288,-2.8269 -4.7764,-7.3221 -5.2812,-13.5313 l 57,0 c 1.3629,10e-5 2.4855,-0.423 3.3438,-1.2812 0.9085,-0.9086 1.3749,-2.0745 1.375,-3.4375 l 0,-4.3125 c -10e-5,-13.5287 -3.8824,-23.9062 -11.6563,-31.125 -7.774,-7.2691 -18.618,-10.8749 -32.5,-10.875 z m 200.77148,0 c -14.7402,10e-5 -26.0313,3.6059 -33.9062,10.875 -7.8749,7.2188 -11.8125,17.9401 -11.8125,32.125 0,14.1345 3.9376,24.8246 11.8125,32.0938 7.8749,7.2691 19.166,10.9062 33.9062,10.9062 14.7907,0 26.125,-3.6371 34,-10.9062 7.8749,-7.2692 11.8125,-17.9593 11.8126,-32.0938 -10e-5,-14.1849 -3.9377,-24.9062 -11.8126,-32.125 -7.875,-7.2691 -19.2093,-10.8749 -34,-10.875 z m 106.82222,0 c -4.9471,10e-5 -9.1851,0.9568 -12.7187,2.875 -3.4832,1.8679 -7.053,4.5602 -10.6875,8.0938 l 0,-4.7813 c 0,-1.3629 -0.4231,-2.4543 -1.2812,-3.Line truncated
|
||||
style="font-size:155.07562256px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:url(#linearGradient14441);fill-opacity:1;stroke:none;font-family:PT Sans;-inkscape-font-specification:PT Sans Bold"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccscsscscscssccccscsssccsccsccccscscscssccccccccsscssccccccccccscscccccscccsssssscscccscccccccsscsccccscccccsccccsscsccccscccccsccccssssccccccscccsssssscsccsccsscccccsccssccsccccccssssccccccccscsscccsscccccccccccccccccccccccscsssccccscssscccccssscccscccccc" />
|
||||
<path
|
||||
sodipodi:nodetypes="cccccsccccsccccczcccccccccccccccccczc"
|
||||
style="fill:url(#radialGradient14443);fill-opacity:1;stroke:none"
|
||||
d="m 540.34375,-1422.0805 c -12.29432,0.3444 -23.16875,4.1084 -30.1875,12.1562 -21.94041,25.1615 2.21091,48.5609 10.59375,80.375 11.19324,42.4518 -1.53635,87.6244 32.4375,117.3438 11.70123,10.2333 25.83068,12.9293 39.40625,14.1875 -17.84802,21.0296 -28.60932,50.1918 -22.75,80.1562 10.25567,52.4474 62.09821,87.3643 113.5,78.5938 29.32083,-5.0046 52.91321,-22.9697 65.75,-47.5 0.46733,-0.8094 1.56181,-0.8131 2.03125,0 12.83808,24.5246 36.43356,42.4961 65.75,47.5 51.4018,8.7705 103.02552,-26.1464 113.28125,-78.5938 5.85926,-29.9644 -4.68318,-59.1266 -22.53125,-80.1562 13.57556,-1.2582 27.48621,-3.9542 39.1875,-14.1875 33.97384,-29.7194 21.24426,-74.892 32.4375,-117.3438 8.38284,-31.8141 32.5029,-55.2135 10.5625,-80.375 -7.01869,-8.0478 -17.64318,-11.8117 -29.9375,-12.1562 -27.05023,-0.7631 -55.22868,10.0899 -83.78125,23.625 -28.55257,13.5351 -60.05514,36.7754 -79.875,61.6562 l 73.15625,42.5 -115.71875,67.1875 -10.125,127.4688 -2.625,-133.3438 -13.6875,-7.9375 -10.0625,126.3125 -2.625,-133.6875 -13.71875,-7.9687 -10.03125,126.7188 -2.6875,-134.0938 -13.625,-7.9062 -10.09375,127.0312 -2.65625,-134.4687 -13.59375,-7.875 -10.125,127.4062 -2.65625,-134.8437 70.0625,-40.6875 c -20.05589,-25.7166 -52.77139,-49.9356 -81.28125,-63.4688 -28.50986,-13.5332 -56.21174,-24.2288 -83.78125,-23.625 z"
|
||||
id="path13218"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 14 KiB |
@@ -1,15 +0,0 @@
|
||||
{%- extends "alabaster/layout.html" %}
|
||||
|
||||
{%- block footer %}
|
||||
<div class="footer">
|
||||
{% if show_copyright %}©{{ copyright }} | {% endif %}
|
||||
Licensed under the <a href="https://creativecommons.org/licenses/by-sa/4.0/">
|
||||
CC BY-SA 4.0</a> license
|
||||
{%- if show_source and has_source and sourcename %}
|
||||
{% if show_copyright or theme_show_powered_by %}|{% endif %}
|
||||
<a href="{{ pathto('_sources/' + sourcename, true)|e }}"
|
||||
rel="nofollow">{{ _('Page source') }}</a>
|
||||
{%- endif %}
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
+14
-6
@@ -15,11 +15,10 @@ list see the documentation: http://www.sphinx-doc.org/en/master/config
|
||||
#
|
||||
import os
|
||||
import sys
|
||||
from datetime import datetime
|
||||
|
||||
import django
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
sys.path.insert(0, os.path.abspath('../../'))
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'plinth.settings'
|
||||
django.setup()
|
||||
@@ -28,7 +27,7 @@ django.setup()
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
project = 'FreedomBox'
|
||||
copyright = f'2021-{datetime.now().year}, FreedomBox Authors'
|
||||
copyright = f'2021-{datetime.now().year}'
|
||||
author = 'FreedomBox Authors'
|
||||
|
||||
# The short X.Y version
|
||||
@@ -84,15 +83,23 @@ 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_book_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 = {
|
||||
'fixed_sidebar': True,
|
||||
'show_related': True,
|
||||
'home_page_in_toc': True,
|
||||
'repository_provider': 'gitlab',
|
||||
'repository_url': 'https://salsa.debian.org/freedombox-team/freedombox/',
|
||||
'use_edit_page_button': True,
|
||||
'use_source_button': True,
|
||||
'use_repository_button': True,
|
||||
'use_issues_button': True,
|
||||
'path_to_docs': 'doc/dev/',
|
||||
'extra_footer': 'Licensed under the <a href="https://creativecommons.org/'
|
||||
'licenses/by-sa/4.0/">CC BY-SA 4.0</a> license.',
|
||||
}
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
@@ -223,3 +230,4 @@ autodoc_mock_imports = [
|
||||
]
|
||||
|
||||
html_favicon = './_static/favicon.ico'
|
||||
html_logo = './_static/logo.svg'
|
||||
Reference in new issue
Block a user