diff options
Diffstat (limited to 'pysite/rst/roles.py')
-rw-r--r-- | pysite/rst/roles.py | 13 |
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], [] |