docs(doc-design): underline role

This commit is contained in:
gwen 2026-06-06 17:29:46 +02:00
parent d0bc7eabc7
commit ba8d3939fe
2 changed files with 18 additions and 2 deletions

View file

@ -1,4 +1,7 @@
.wy-table-responsive table td { .wy-table-responsive table td {
white-space: normal; white-space: normal;
} }
.underline {
text-decoration: underline;
}

View file

@ -86,7 +86,7 @@ html_show_copyright = True
# The name of the Pygments (syntax highlighting) style to use. # The name of the Pygments (syntax highlighting) style to use.
pygments_style = None pygments_style = None
html_static_path = ['_static'] 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. # Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates'] templates_path = ['_templates']
@ -116,6 +116,19 @@ language = 'en'
# This pattern also affects html_static_path and html_extra_path. # This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['.venv', 'build', '_build', 'Thumbs.db', '.DS_Store'] 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): def setup(app):
app.add_role('underline', underline_role)
app.add_css_file('css/custom.css') app.add_css_file('css/custom.css')