From 97daf64816b96128210bf3986c6904dff3f2b29f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Ricart?= Date: Mon, 17 Feb 2025 13:57:20 +0100 Subject: [PATCH] add datatable plugin --- source/conf.py | 6 ++++-- template/debian.rst.j2 | 13 ++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/source/conf.py b/source/conf.py index 368036a..b675df4 100644 --- a/source/conf.py +++ b/source/conf.py @@ -13,7 +13,9 @@ author = 'Michaƫl Ricart' # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration -extensions = [] +extensions = [ + "sphinx_datatables", +] templates_path = ['_templates'] exclude_patterns = [] @@ -28,7 +30,7 @@ html_theme = "sphinx_rtd_theme" html_static_path = ['_static'] # These paths are either relative to html_static_path -# or fully qualified paths (eg. https://...) +# or fully qualifieed paths (eg. https://...) #html_style = 'css/custom.css' html_css_files = [ 'css/custom.css', diff --git a/template/debian.rst.j2 b/template/debian.rst.j2 index fac790b..576e31c 100644 --- a/template/debian.rst.j2 +++ b/template/debian.rst.j2 @@ -15,8 +15,11 @@ interface adresses services -------- -================================================== ==================== ============== -service state description -================================================== ==================== =============={% for svc in services %} -{{ "{:<50}".format(svc["unit"][:49]) }} {{ "{:<20}".format(svc["sub"].replace("running",":green:`running`").replace("failed", ":red:`failed`")) }} {{ svc["description"] }}{% endfor %} -================================================== ==================== ============== +.. table:: services + :class: sphinx-datatable + + ================================================== ==================== ============== + service state description + ================================================== ==================== =============={% for svc in services %} + {{ "{:<50}".format(svc["unit"][:49]) }} {{ "{:<20}".format(svc["sub"].replace("running",":green:`running`").replace("failed", ":red:`failed`")) }} {{ svc["description"] }}{% endfor %} + ================================================== ==================== ==============