diff options
| author | mb21 <[email protected]> | 2021-03-20 10:10:08 +0100 |
|---|---|---|
| committer | mb21 <[email protected]> | 2021-03-20 10:10:08 +0100 |
| commit | f6e9e61a483ccfc30bd156be84e1e4fdb58c8625 (patch) | |
| tree | ba05ab27a2fce0dd47f0a147f73f7a5186c90ff1 | |
| parent | 937bffd04361d4e05d9a9eec96d4ee1a1fd3ac20 (diff) | |
set highlight-style-dark variable
| -rw-r--r-- | data/templates/styles.html | 9 | ||||
| -rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 8 |
2 files changed, 12 insertions, 5 deletions
diff --git a/data/templates/styles.html b/data/templates/styles.html index 09b9061e4..ad8b9aa88 100644 --- a/data/templates/styles.html +++ b/data/templates/styles.html @@ -189,14 +189,17 @@ $endif$ border-color: #707070; color: #d3d3d3; } - pre, code, div.sourceCode { - background-color: #1b1b1b; - } hr { background-color: #d3d3d3; } tbody, th { border-color: #d3d3d3; } + pre, code { + background-color: #1b1b1b; + } + $if(highlighting-css-dark)$ + $highlighting-css-dark$ + $endif$ } diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 332de1545..12cf031ee 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -45,8 +45,8 @@ import Text.Blaze.Internal (MarkupM (Empty), customLeaf, customParent) import Text.DocTemplates (FromContext (lookupContext), Context (..)) import Text.Blaze.Html hiding (contents) import Text.Pandoc.Definition -import Text.Pandoc.Highlighting (formatHtmlBlock, formatHtmlInline, highlight, - styleToCss) +import Text.Pandoc.Highlighting (breezeDark, formatHtmlBlock, formatHtmlInline, + highlight, styleToCss) import Text.Pandoc.ImageSize import Text.Pandoc.Options import Text.Pandoc.Shared @@ -323,6 +323,10 @@ pandocToHtml opts (Pandoc meta blocks) = do (T.pack $ styleToCss sty) Nothing -> id else id) . + (if stHighlighting st + then defField "highlighting-css-dark" + (T.pack $ styleToCss breezeDark) + else id) . (if stCsl st then defField "csl-css" True . (case stCslEntrySpacing st of |
