docs(doc-design): underline role
This commit is contained in:
parent
d0bc7eabc7
commit
ba8d3939fe
2 changed files with 18 additions and 2 deletions
3
docs/_static/css/custom.css
vendored
3
docs/_static/css/custom.css
vendored
|
|
@ -1,4 +1,7 @@
|
|||
.wy-table-responsive table td {
|
||||
white-space: normal;
|
||||
}
|
||||
.underline {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
|
|
|
|||
17
docs/conf.py
17
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')
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue