From 85f8c51b640a127f77067903cdbddec05bd3a77b Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 16 Jul 2010 00:23:13 -0700 Subject: Use default highlighting CSS rather than embedding CSS in templates. --- src/Text/Pandoc/Writers/HTML.hs | 5 +++-- templates/html.template | 21 ++------------------- templates/slidy.template | 21 ++------------------- tests/lhs-test.html | 25 ++++++++++++------------- tests/lhs-test.html+lhs | 25 ++++++++++++------------- 5 files changed, 31 insertions(+), 66 deletions(-) diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index e9006a39b..a0366006d 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -34,7 +34,7 @@ import Text.Pandoc.CharacterReferences ( decodeCharacterReferences ) import Text.Pandoc.Shared import Text.Pandoc.Templates import Text.Pandoc.Readers.TeXMath -import Text.Pandoc.Highlighting ( highlightHtml ) +import Text.Pandoc.Highlighting ( highlightHtml, defaultHighlightingCss ) import Text.Pandoc.XML (stripTags, escapeStringForXML) import Network.HTTP ( urlEncode ) import Numeric ( showHex ) @@ -136,7 +136,8 @@ pandocToHtml opts (Pandoc (Meta title' authors' date') blocks) = do primHtml s Nothing -> noHtml else noHtml - let newvars = [("highlighting","yes") | stHighlighting st] ++ + let newvars = [("highlighting-css", defaultHighlightingCss) | + stHighlighting st] ++ [("math", renderHtmlFragment math) | stMath st] return (tit, auths, date, toc, thebody, newvars) diff --git a/templates/html.template b/templates/html.template index da4a1b23e..bd1864ff0 100644 --- a/templates/html.template +++ b/templates/html.template @@ -10,26 +10,9 @@ $endfor$ $if(date)$ $endif$ -$if(highlighting)$ +$if(highlighting-css)$ $endif$ $for(css)$ diff --git a/templates/slidy.template b/templates/slidy.template index a7b2327bb..d43d7b96d 100644 --- a/templates/slidy.template +++ b/templates/slidy.template @@ -12,26 +12,9 @@ $endfor$ $if(date)$ $endif$ -$if(highlighting)$ +$if(highlighting-css)$ $endif$ $for(css)$ diff --git a/tests/lhs-test.html b/tests/lhs-test.html index 8370c0594..4e69852a3 100644 --- a/tests/lhs-test.html +++ b/tests/lhs-test.html @@ -7,20 +7,19 @@ diff --git a/tests/lhs-test.html+lhs b/tests/lhs-test.html+lhs index 3df53e1aa..20a21091f 100644 --- a/tests/lhs-test.html+lhs +++ b/tests/lhs-test.html+lhs @@ -7,20 +7,19 @@ -- cgit v1.2.3