aboutsummaryrefslogtreecommitdiffstats
path: root/pysite/rst/roles.py
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2018-06-08 17:56:15 +0100
committerGravatar Gareth Coles <[email protected]>2018-06-08 17:56:15 +0100
commit60838b789f7e1a307751e13f45e62495dd65bd10 (patch)
tree4d4d86da08c5eb54ba2976d371a7da593311bafa /pysite/rst/roles.py
parentFix test (diff)
Fix RST table styling and add fira-code text role
Diffstat (limited to 'pysite/rst/roles.py')
-rw-r--r--pysite/rst/roles.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/pysite/rst/roles.py b/pysite/rst/roles.py
index abade243..d83f07f9 100644
--- a/pysite/rst/roles.py
+++ b/pysite/rst/roles.py
@@ -110,3 +110,16 @@ def page_role(_role: str, rawtext: str, text: str, lineno: int, inliner: Inliner
prb = inliner.problematic(text, rawtext, msg)
return [prb], [msg]
+
+
+def fira_code_role(_role: str, rawtext: str, text: str, lineno: int, inliner: Inliner,
+ options: dict = None, _content: dict = None):
+ if options is None:
+ options = {}
+
+ set_classes(options)
+
+ html = f"""<span class="fira-code">{text}</span>"""
+ node = nodes.raw(html, html, format="html", **options)
+
+ return [node], []