diff --git a/.editorconfig b/.editorconfig index 56549e5fc4fb75a202321aa648316e188fd07ec0..18b3b9e50de5c7e2f57e168d8e5f203310508f3c 100644 --- a/.editorconfig +++ b/.editorconfig @@ -14,21 +14,17 @@ insert_final_newline = false trim_trailing_whitespace = true # Size of indentation (either tabs or space) indent_size = 2 +# Type of indentation (either tabs or space) +indent_style = space +# Maximum length (in number of chars) for a line +max_line_length = 80 # Python specific syntax [*.py] -# Type of indentation (either tabs or space) -indent_style = space # Size of indentation (either tabs or space) indent_size = 4 -# Maximum length (in number of chars) for a line -max_line_length = 80 # Yaml specific syntax [*.{yaml,yml}] -# Type of indentation (either tabs or space) -indent_style = space -# Size of indentation (either tabs or space) -indent_size = 2 # Maximum length (in number of chars) for a line max_line_length = 120 diff --git a/.yamllint b/.yamllint index 3495186795ee7116502158bdce32069a5e392003..67598ce0364db49fb507fd1e794ba2607a9c2239 100644 --- a/.yamllint +++ b/.yamllint @@ -34,8 +34,3 @@ rules: type: unix trailing-spaces: disable truthy: disable - -# ***************************************************************************** -# VIM MODELINE -# vim: ft=yaml: fdm=indent: -# ***************************************************************************** diff --git a/mkdocs.yml b/mkdocs.yml index 207c47b19ee77ef9fd9853357e47fcf7ce557510..35fc5cd6dc14fd7152efe56b5455bac940acc89e 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -28,7 +28,7 @@ theme: # https://squidfunk.github.io/mkdocs-material/ name: material # Overriding parent theme configuration - #custom_dir: docs/theme + custom_dir: docs/theme # Determines whether the search plugin expects the theme to provide a # dedicated search page via a template located at search/search.html. include_search_page: false @@ -44,37 +44,79 @@ theme: - navigation.tabs - navigation.instant - navigation.top - # Setting colors palette + # Setting colors palette (these are defined in docs/theme/css/{colors,theme}.css) palette: - # Light mode + # Light mode - media: "(prefers-color-scheme: light)" - scheme: default - primary: deep-purple - accent: yellow + scheme: rdeville-light + primary: rdeville-green-light + accent: rdeville-orange-light toggle: - icon: material/weather-sunny + icon: material/weather-night name: Switch to dark mode # Dark mode - media: "(prefers-color-scheme: dark)" - scheme: slate - primary: deep-purple - accent: yellow + scheme: rdeville-dark + primary: rdeville-green-dark + accent: rdeville-orange-dark toggle: - icon: material/weather-night + icon: material/weather-sunny name: Switch to light mode - # Font configuration for the website + # Font configuration for the website (FurCode are provided in + # docs/theme/fonts) font: false - # text: - # code: + # text: FuraCode Nerd Font + # code: FuraCode Nerd Font # Path to logo and icons to use for the website #logo: # Automatically set by mkdocs_macros_plugin (see docs/_data/plugins.py) #icon: # repo: # Automatically set by mkdocs_macros_plugin (see docs/_data/plugins.py) #favicon: # Automatically set by mkdocs_macros_plugin (see docs/_data/plugins.py) +# External CSS +# --------------------------------------------------------------------------- +extra_css: + # Define css for lightgallery + # From: https://github.com/g-provost/lightgallery-markdown + - theme/css/lightgallery.css + # Define personal extra css + # Define colors (all materials colors RGB code) + - theme/css/colors.css + # Define fonts + - theme/css/fonts.css + # Define themes + - theme/css/theme.css + # Define css of base markdown extension and pymdown extension + - theme/css/python_markdown_extension.css + +# External JS +# --------------------------------------------------------------------------- +extra_javascript: + # Define javascript for lightgallery + # From: https://github.com/g-provost/lightgallery-markdown + - theme/js/lightgallery.js + - theme/js/lg-video.js + # Define javascript for arithmatex (auto downloaded with tools/upgrade_external_dependencies) + # From: https://squidfunk.github.io/mkdocs-material/reference/mathjax/#arithmatex + - theme/js/polyfill.js + - theme/js/es5/tex-chtml.js + # Define javascript to allow table sorting + # From: https://squidfunk.github.io/mkdocs-material/reference/data-tables/#sortable-tables + - theme/js/tablesort.min.js + # Define javascript for mermaid + # From: https://github.com/fralau/mkdocs-mermaid2-plugin#explicit-declaration-of-the-mermaid-library + - theme/js/mermaid.js + # Define javascript for custom pymdown mermaid loader + # From: https://facelessuser.github.io/pymdown-extensions/extras/mermaid/#custom-loader + - theme/js/mermaid-loader.js + # Define personal custom javascript + - theme/js/extra.js + # Extensions # --------------------------------------------------------------------------- markdown_extensions: + # Allow to include markdown files + # https://github.com/sethen/markdown-include - markdown_include.include: base_path: ./ # Python Markdown Extensions @@ -94,53 +136,97 @@ markdown_extensions: - markdown.extensions.md_in_html: # Pymdown Extensions # https://facelessuser.github.io/pymdown-extensions/extensions/arithmatex/ + - pymdownx.extra: + - pymdownx.arithmatex: + generic: true - pymdownx.betterem: - - pymdownx.tabbed: - - pymdownx.superfences: - preserve_tabs: true - # Make exceptions to highlighting code of following classes: - custom_fences: + - pymdownx.details: + - pymdownx.caret: + - pymdownx.escapeall: + hardbreak: True + nbsp: True + - pymdownx.critic: + - pymdownx.emoji: + emoji_index: !!python/name:pymdownx.emoji.twemoji + emoji_generator: !!python/name:pymdownx.emoji.to_svg + options: + image_path: /assets/twemoji/svg/ + custom_icons: + - .icons + - pymdownx.inlinehilite: + custom_inline: - name: math class: arithmatex - format: !!python/name:pymdownx.arithmatex.fence_mathjax_format + format: !!python/name:pymdownx.arithmatex.inline_generic_format - pymdownx.highlight: + linenums: true + linenums_special: 2 + linenums_style: pymdownx-inline + guess_lang: false extend_pygments_lang: - - name: php-inline - lang: php - options: - startinline: true - name: pycon3 lang: pycon options: python3: true - linenums_style: pymdownx-inline - - pymdownx.inlinehilite: - custom_inline: + - pymdownx.keys: + separator: "\uff0b" + - pymdownx.mark: + - pymdownx.magiclink: + repo_url_shortener: true + - pymdownx.progressbar: + - pymdownx.pathconverter: + - pymdownx.smartsymbols: + - pymdownx.snippets: + - pymdownx.striphtml: + - pymdownx.superfences: + preserve_tabs: true + # Make exceptions to highlighting code of following classes: + custom_fences: - name: math class: arithmatex - format: !!python/name:pymdownx.arithmatex.inline_mathjax_format - - pymdownx.tilde: - - pymdownx.caret: - - pymdownx.critic: - - pymdownx.smartsymbols: - - pymdownx.emoji: - emoji_index: !!python/name:materialx.emoji.twemoji - emoji_generator: !!python/name:materialx.emoji.to_svg - options: - custom_icons: - - .icons - - pymdownx.escapeall: - hardbreak: True - nbsp: True + format: !!python/name:pymdownx.arithmatex.fence_generic_format + - name: mermaid + class: mermaid + format: !!python/name:pymdownx.superfences.fence_code_format + - pymdownx.tabbed: - pymdownx.tasklist: custom_checkbox: true - - pymdownx.progressbar: - - pymdownx.arithmatex: - - pymdownx.mark: - - pymdownx.striphtml: - - pymdownx.keys: - separator: "\uff0b" - - pymdownx.details: + - pymdownx.tilde: + # Locally installed in docs/theme/plugins/ from original repo + # https://github.com/g-provost/lightgallery-markdown + - lightgallery: + +# Extra Data Information & Customization +# --------------------------------------------------------------------------- +# Dictionary storing social icon that will be shown on the bottom right. +extra: + social: + - icon: fontawesome/solid/globe + link: https://romaindeville.fr + name: R. Deville Wesite + - icon: fontawesome/solid/paper-plane + link: mailto:contact@romaindeville.fr + name: "Send mail to @rdeville" + - icon: fontawesome/solid/book-reader + link: https://docs.romaindeville.fr + name: All Projects Home Documentation + - icon: fontawesome/brands/linkedin + link: https://www.linkedin.com/in/romaindeville + name: "@rdeville on LinkedIn" + - icon: fontawesome/brands/docker + link: https://hub.docker.com/u/rdeville + name: "@rdeville on Docker Hub" + - icon: fontawesome/brands/git-alt + link: https://framagit.org/rdeville.public/ + name: "@rdeville on Framagit" + - icon: fontawesome/brands/gitlab + link: https://gitlab.com/rdeville.public/ + name: "@rdeville on Gitlab" + - icon: fontawesome/brands/github + link: https://github.com/rdeville-public/ + name: "@rdeville on Github" + version: + provider: mike # Plugins # --------------------------------------------------------------------------- @@ -173,6 +259,12 @@ plugins: # This plugin enables you to build multiple sets of documentation in a # single Mkdocs. - monorepo: + # A Mermaid graphs plugin for mkdocs + # https://github.com/fralau/mkdocs-mermaid2-plugin#declaring-the-superfences-extension + - mermaid2: + arguments: + theme: | + ^(localStorage.getItem('theme') === 'rdeville-dark') ? 'dark' : 'light' # https://pawamoy.github.io/mkdocstrings/ # Automatic documentation from sources, for MkDocs. - mkdocstrings: @@ -182,17 +274,23 @@ plugins: rendering: show_source: true show_if_no_docstring: true + show_root_heading: false + show_root_toc_entry: false + show_root_full_path: true + show_object_full_path: true + show_root_members_full_path: true + show_category_heading: true + show_signature_annotations: false + group_by_category: true + heading_level: 2 setup_commands: - import sys # Others command such as sys.path.append("path") are # Automatically added using mkdocs_macros_plugin # (see docs/_data/plugins.py) -# DO NOT FORGET TO ADD/UPDATE THE \`nav\` AND \`extra\` KEYS BELOW. +# DO NOT FORGET TO ADD/UPDATE THE \`nav\` KEY BELOW. ### END MKDOCS TEMPLATE ### -extra: - version: - provider: mike # Navigation Pane # --------------------------------------------------------------------------- nav: diff --git a/pyproject.toml b/pyproject.toml index 89c4b5120b08a52634b524bd1dd59805629cb4d1..cea64ce6be9557abde1308b5325b9f86bd146896 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -69,6 +69,7 @@ commands = -not -path "./python_venv/*" \\) ) ' bash -c 'DIRENV_ROOT="$(pwd)" ./tools/generate_source_docs.sh --dry-run' + [testenv:build_doc] # Allow external commands allowlist_externals=