taler-xotp

xOTP generator
Log | Files | Refs | Submodules | README

conf.py (6865B)


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