diff --git a/.gitignore b/.gitignore index 8de6ad354..4751e8f27 100644 --- a/.gitignore +++ b/.gitignore @@ -166,8 +166,8 @@ Temporary Items # This directory rebuilds on 'tox -e docs' therefore not needed in repo docs/api docs/plantuml.jar -docs/_static -docs/compatibility_matrix.csv +docs/_static/images +docs/_static/tables # version number for bo4e-python; gets auto-generated during the command # python -m build diff --git a/docs/_static/css/colors.css b/docs/_static/css/colors.css new file mode 100644 index 000000000..fc2b5d291 --- /dev/null +++ b/docs/_static/css/colors.css @@ -0,0 +1,18 @@ + +:root { + /* These colors should stay consistent with the colors used in the CLI: + https://github.com/bo4e/BO4E-CLI/blob/main/src/bo4e_cli/io/console/style.py#L238 */ + --main-color: #8cc04d; + --sub-color: #617d8b; + --error-color: #e35b3a; +} + +.main-color { + color: var(--main-color); +} +.sub-color { + color: var(--sub-color); +} +.error-color { + color: var(--error-color); +} diff --git a/docs/_static/css/override.css b/docs/_static/css/override.css new file mode 100644 index 000000000..09759cc31 --- /dev/null +++ b/docs/_static/css/override.css @@ -0,0 +1,5 @@ + +.rst-content table .line-block:last-child { + /* Remove the margin-bottom from the line-blocks inside tables. Example in changelog.rst. */ + margin-bottom: 0; +} diff --git a/docs/changelog.rst b/docs/changelog.rst index cc51e8bc1..121b9a1d5 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -20,29 +20,27 @@ You can also download the compatibility matrix as CSV file `here <_static/tables .. table:: Legend for compatibility matrix :widths: 10 90 - +------+------------------------------------------------------+ - | Icon | Description | - +======+======================================================+ - | 🟢 | Compatible | - | | No changes in the data model | - +------+------------------------------------------------------+ - | 🟡 | Compatible | - | | Only non-critical changes in the data model | - | | e.g. added fields, changed doc strings | - +------+------------------------------------------------------+ - | 🔴 | Incompatible | - | | Critical changes in the data model | - | | e.g. removed fields, changed types | - +------+------------------------------------------------------+ - | ➕ | Compatible | - | | Data model was added in this version | - +------+------------------------------------------------------+ - | ➖ | Incompatible | - | | Data model was removed in this version | - +------+------------------------------------------------------+ - | \- | Data model not existent in this version | - | | was removed before or will be added in future | - +------+------------------------------------------------------+ + +------+---------------------------------------------------------------------------------------------------+ + | Icon | Description | + +======+===================================================================================================+ + | 🟢 | | :main-color:`Compatible` | + | | | No changes in the data model | + +------+---------------------------------------------------------------------------------------------------+ + | 🟡 | | :main-color:`Compatible` | + | | | Only non\-critical changes in the data model e.g. added fields, changed doc strings | + +------+---------------------------------------------------------------------------------------------------+ + | 🔴 | | :error-color:`Incompatible` | + | | | Critical changes in the data model e.g. removed fields, changed types | + +------+---------------------------------------------------------------------------------------------------+ + | ➕ | | :main-color:`Compatible` | + | | | Data model was added in this version | + +------+---------------------------------------------------------------------------------------------------+ + | ➖ | | :error-color:`Incompatible` | + | | | Data model was removed in this version | + +------+---------------------------------------------------------------------------------------------------+ + | \- | | Non\-existent | + | | | Doesn't exist in this version i.e. it was removed before or will be added in future | + +------+---------------------------------------------------------------------------------------------------+ .. csv-table:: Compatibility matrix :file: _static/tables/compatibility_matrix.csv diff --git a/docs/conf.py b/docs/conf.py index 3a97750c6..7db16feae 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -194,6 +194,16 @@ def setup(app): "titles_only": False, } +html_css_files = [ + "css/override.css", + "css/colors.css", +] +rst_prolog = """ +.. role:: main-color +.. role:: sub-color +.. role:: error-color +""" + # Add any paths that contain custom themes here, relative to this directory. # html_theme_path = []