From 60838b789f7e1a307751e13f45e62495dd65bd10 Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Fri, 8 Jun 2018 17:56:15 +0100 Subject: Fix RST table styling and add fira-code text role --- pysite/rst/roles.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'pysite/rst/roles.py') 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"""{text}""" + node = nodes.raw(html, html, format="html", **options) + + return [node], [] -- cgit v1.2.3