X-Git-Url: https://git.madduck.net/etc/mutt.git/blobdiff_plain/3803d2cf1b594cc4d5001dea7a3c5b9dafaf0a2a..df7778d191c99b4abf5eb6670d3686e1b7a5b1b8:/.mutt/markdown2html diff --git a/.mutt/markdown2html b/.mutt/markdown2html index d4f5b13..4bb1a9d 100755 --- a/.mutt/markdown2html +++ b/.mutt/markdown2html @@ -48,6 +48,11 @@ except ImportError: DEFAULT_CSS += ''' +.block { + padding: 0 0.5em; + margin: 0; + border-left: 2px solid #eee; +} .quote, blockquote { padding: 0 0.5em; margin: 0; @@ -102,7 +107,6 @@ HTML_DOCUMENT = ''' -HTML E-Mail {htmlbody} ''' @@ -210,7 +214,7 @@ def _reformat_quotes(html): def _convert_with_pandoc(mdwn, inputfmt='markdown', outputfmt='html5', ext_enabled=None, ext_disabled=None, - standalone=True, title="HTML E-Mail"): + standalone=True, selfcontained=True, title="HTML E-Mail"): ''' Invoke pandoc to do the actual conversion of Markdown to HTML5. ''' @@ -253,6 +257,8 @@ def _convert_with_pandoc(mdwn, inputfmt='markdown', outputfmt='html5', args = [] if standalone: args.append('--standalone') + if selfcontained: + args.append('--self-contained') if title: args.append(f'--metadata=pagetitle:"{title}"') @@ -290,7 +296,7 @@ def convert_markdown_to_html(mdwn): if body: body = _preprocess_markdown(body) body = _identify_quotes_for_later(body) - html = _convert_with_pandoc(body, standalone=False) + html = _convert_with_pandoc(body, standalone=True, selfcontained=True) html = _reformat_quotes(html) if sig: