diff --git a/scripts/generate.py b/scripts/generate.py index ed8bc2b..54e9c22 100644 --- a/scripts/generate.py +++ b/scripts/generate.py @@ -601,8 +601,22 @@ def render_text_tokens(tokens, acc, headline, graph): except NonExistingLocalNoteError as err: logging.warning(err.get_message()) acc.append(html.escape(description)) - # else: - # raise NotImplementedError('TextToken: {}'.format(chunk)) + elif isinstance(chunk, org_rw.MarkerToken): + tag = '<' + if chunk.closing: + tag += '/' + tag += { + org_rw.MarkerType.BOLD_MODE: 'strong', + org_rw.MarkerType.CODE_MODE: 'code', + org_rw.MarkerType.ITALIC_MODE: 'em', + org_rw.MarkerType.STRIKE_MODE: 's', + org_rw.MarkerType.UNDERLINED_MODE: 'span class="underlined"' if not chunk.closing else 'span', + org_rw.MarkerType.VERBATIM_MODE: 'span class="verbatim"' if not chunk.closing else 'span', + }[chunk.tok_type] + tag += '>' + acc.append(tag) + else: + raise NotImplementedError('TextToken: {}'.format(chunk)) acc.append('

') diff --git a/static/style.css b/static/style.css index c61946d..ac60d78 100644 --- a/static/style.css +++ b/static/style.css @@ -340,6 +340,11 @@ a.internal::after { content: ' }'; } +/* Markup */ +.underlined { + text-decoration: underline; +} + /* Code blocks */ pre { overflow: auto; @@ -366,7 +371,7 @@ pre code { padding: 0.5ex; } -code { +code, .verbatim { padding: 0.25ex 0.5ex; margin: 0.25ex; background: #eee; @@ -542,7 +547,7 @@ tr.__table-separator { color: #fff; } - code { + code, .verbatim { background: #262826; color: #FFF; font-family: Menlo, Monaco, "Courier New", monospace;