taler-xotp

xOTP generator
Log | Files | Refs | Submodules | README

conf.py (6827B)


      1 # Configuration file for the Sphinx documentation builder.
      2 #
      3 # For the full list of built-in configuration values, see the documentation:
      4 # https://www.sphinx-doc.org/en/master/usage/configuration.html
      5 
      6 # -- Project information -----------------------------------------------------
      7 # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
      8 
      9 from datetime import datetime
     10 
     11 # Project configuration variables
     12 
     13 project = "xOTP Generator Online Manual"
     14 author = "Adrian STEINER"
     15 copyright = str(datetime.now().year) + f", xOTP Generator, {author}"
     16 release = "0.0.1"
     17 
     18 site_url = "https://xotp.gitlab.io/documentation/"
     19 repo_url = (
     20     "https://git-www.taler.net/taler-xotp.git/"
     21 )
     22 repo_name = "xOTP Repo"
     23 pageLogo = "bfh/logo"
     24 
     25 # -- General configuration ---------------------------------------------------
     26 # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
     27 
     28 extensions = [
     29     "sphinx_immaterial",
     30     "sphinx.ext.autosectionlabel",
     31     "sphinxcontrib.video",
     32     "sphinx_immaterial.kbd_keys",
     33     "sphinx_embedpdf.sphinx_embedpdf",
     34     "myst_parser",
     35 ]
     36 
     37 html_sidebars = {
     38     "**": ["logo-text.html", "globaltoc.html", "localtoc.html", "searchbox.html"]
     39 }
     40 
     41 # Add prefix to use the same headers in an other document
     42 autosectionlabel_prefix_document = True
     43 
     44 # Add to reference to headers til header 4
     45 myst_heading_anchors = 4
     46 
     47 # Reference files
     48 source_suffix = {
     49     ".rst": "restructuredtext",
     50     ".md": "markdown",
     51     ".txt": "restructuredtext",
     52     ".lnk": "restructuredtext",
     53 }
     54 
     55 master_doc = "index"
     56 
     57 templates_path = ["_templates"]
     58 exclude_patterns = []
     59 
     60 # some customizations on styles - relative path to _static
     61 html_css_files = [
     62     #    'styles/custom.css',
     63     "styles/bfh.css",
     64     "styles/twocol.css",
     65     "styles/cond-item.css",
     66     "styles/lists.css",
     67     "styles/bfh-tables.css",
     68     "styles/figureHacks.css",
     69 ]
     70 
     71 ## -- sphinx-immaterial additional admonitions ------------------------------
     72 sphinx_immaterial_custom_admonitions = [
     73     {
     74         "name": "demo",
     75         "color": (43, 155, 70),
     76         "icon": "fontawesome/solid/arrow-up-right-dots",
     77         "classes": ["demo"],
     78         "override": True,
     79     },
     80     {
     81         "name": "solution",
     82         "classes": ["success"],
     83     },
     84     {
     85         "name": "outcomes",
     86         "icon": "material/compass-outline",
     87         "classes": ["success"],
     88     },
     89     {
     90         "name": "objectives",
     91         "classes": ["abstract"],
     92     },
     93     {
     94         "name": "exercise",
     95         "color": (150, 130, 95),
     96         "icon": "fontawesome/solid/pen-to-square",
     97         "classes": ["exercise"],
     98         "override": True,
     99     },
    100     {"name": "optional", "color": (130, 90, 125), "classes": ["optional"]},
    101     {
    102         "name": "discussion",
    103         "color": (105, 150, 115),
    104         "icon": "fontawesome/solid/comments",
    105         "classes": ["discussion"],
    106         "override": True,
    107     },
    108 ]
    109 
    110 # material theme options (see theme.conf for more information)
    111 html_theme_options = {
    112     "icon": {
    113         "repo": "fontawesome/brands/git-alt",
    114         #        "edit": "material/file-edit-outline",
    115         "logo": pageLogo,  # General path to logo, must be in the _templates.icons path
    116     },
    117     # "languages": [
    118     #     {
    119     #         "name": "English",
    120     #         "link": "/",  # points to ./en/ subdirectory
    121     #         "lang": "en",
    122     #     },
    123     #     {
    124     #         "name": "German",
    125     #         "link": "de/",  # points to ./en/ subdirectory
    126     #         "lang": "de",
    127     #     },
    128     #     {
    129     #         "name": "French",
    130     #         "link": "fr/",  # points to ./fr/ subdirectory
    131     #         "lang": "fr",
    132     #     },
    133     # ],
    134     "site_url": site_url,
    135     "repo_url": repo_url,
    136     "repo_name": repo_name,
    137     #    "edit_uri": "blob/main/docs",
    138     "globaltoc_collapse": True,
    139     "features": [
    140         "navigation.expand",
    141         # "navigation.tabs",
    142         # "toc.integrate",
    143         "navigation.sections",
    144         # "navigation.instant",
    145         # "header.autohide",
    146         "navigation.top",
    147         # "navigation.tracking",
    148         "search.highlight",
    149         "search.share",
    150         "toc.follow",
    151         "toc.sticky",
    152         "content.tabs.link",
    153         "announce.dismiss",
    154     ],
    155     "palette": [
    156         {
    157             "media": "(prefers-color-scheme: light)",
    158             "scheme": "default",
    159             "primary": "blue-grey",
    160             "accent": "yellow",
    161             "toggle": {
    162                 "icon": "material/weather-night",
    163                 "name": "Switch to dark mode",
    164             },
    165         },
    166         {
    167             "media": "(prefers-color-scheme: dark)",
    168             "scheme": "slate",
    169             "primary": "amber",
    170             "accent": "amber",
    171             "toggle": {
    172                 "icon": "material/weather-sunny",
    173                 "name": "Switch to light mode",
    174             },
    175         },
    176     ],
    177     "font": {
    178         "text": "Lunasima",  # used for all the pages' text
    179         "code": "Fira Code",  # used for literal code blocks
    180     },
    181     # # BEGIN: version_dropdown
    182     # "version_dropdown": True,
    183     # "version_info": [
    184     #     {
    185     #         "version": "https://sphinx-immaterial.rtfd.io",
    186     #         "title": "ReadTheDocs",
    187     #         "aliases": [],
    188     #     },
    189     #     {
    190     #         "version": "https://jbms.github.io/sphinx-immaterial",
    191     #         "title": "Github Pages",
    192     #         "aliases": [],
    193     #     },
    194     # ],
    195     # # END: version_dropdown
    196     "toc_title_is_page_title": True,
    197     # BEGIN: social icons
    198     "social": [
    199         {
    200             "icon": "xOTP_icon",
    201             "link": "https://xotp.gitlab.io/website/",
    202             "name": "xOTP Landing Page",
    203         },
    204         {
    205             "icon": "bfh/dark",
    206             "link": "https://www.bfh.ch/ti",
    207             "name": "BFH-TI",
    208         },
    209     #     {
    210     #         "icon": "mseLogo",
    211     #         "link": "https://www.msengineering.ch/",
    212     #         "name": "MSE",
    213     #     },
    214         {
    215             "icon": "talerLogo",
    216             "link": "https://taler.net",
    217             "name": "GNU Taler",
    218         }
    219     ],
    220     # END: social icons
    221 }
    222 
    223 # -- Options for HTML output -------------------------------------------------
    224 # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
    225 
    226 html_theme = "sphinx_immaterial"
    227 html_static_path = [
    228     "_static",
    229     "../schematics",
    230     "../taler-xotp_hw/board/datasheets",
    231     # "../pictures",
    232 #     "../userManual/_output",
    233 #     "../requirementsEngineering/_output",
    234 #     "../report/_output",
    235 #     "../measurements",
    236 #     "../docs",
    237 ]
    238 # html_logo = '_templates/.icons/logo.svg' # Do not use this html logo variable, the icon is set at html_theme_options{"icon": {"logo": <path>}
    239 html_favicon = "../figures/xOTP_generator_logo.svg"  # Icon on browser tab window
    240 html_title = project