From ba8d3939fe4384968fd0df0b71bb39029e64baca Mon Sep 17 00:00:00 2001 From: gwen Date: Sat, 6 Jun 2026 17:29:46 +0200 Subject: [PATCH] docs(doc-design): underline role --- docs/_static/css/custom.css | 3 +++ docs/conf.py | 17 +++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/docs/_static/css/custom.css b/docs/_static/css/custom.css index 0d59fcadf..c78c5ca75 100644 --- a/docs/_static/css/custom.css +++ b/docs/_static/css/custom.css @@ -1,4 +1,7 @@ .wy-table-responsive table td { white-space: normal; } +.underline { + text-decoration: underline; +} diff --git a/docs/conf.py b/docs/conf.py index 33f720570..07fbac204 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -86,7 +86,7 @@ html_show_copyright = True # The name of the Pygments (syntax highlighting) style to use. pygments_style = None html_static_path = ['_static'] -html_css_files = ['terminal.css'] +html_css_files = ['terminal.css', 'custom.css'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -116,6 +116,19 @@ language = 'en' # This pattern also affects html_static_path and html_extra_path. exclude_patterns = ['.venv', 'build', '_build', 'Thumbs.db', '.DS_Store'] +# ------------------------------------------------------------------------------ +## underline role +## sample: Voici du texte :underline:`souligné`. + +from docutils import nodes +from docutils.parsers.rst import roles + +def underline_role(name, rawtext, text, lineno, inliner, options={}, content=[]): + node = nodes.inline(rawtext, text, **options) + node['classes'].append('underline') + return [node], [] def setup(app): - app.add_css_file('css/custom.css') + app.add_role('underline', underline_role) + app.add_css_file('css/custom.css') +