aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs5
-rw-r--r--templates/html.template21
-rw-r--r--templates/slidy.template21
-rw-r--r--tests/lhs-test.html25
-rw-r--r--tests/lhs-test.html+lhs25
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)$
<meta name="date" content="$date$" />
$endif$
-$if(highlighting)$
+$if(highlighting-css)$
<style type="text/css">
-table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode, table.sourceCode pre
- { margin: 0; padding: 0; border: 0; vertical-align: baseline; border: none; }
-td.lineNumbers { text-align: right; background-color: #EBEBEB; color: black; padding-right: 5px; padding-left: 5px; }
-td.sourceCode { padding-left: 5px; }
-pre.sourceCode { }
-pre.sourceCode span.kw { font-weight: bold; }
-pre.sourceCode span.dt { color: #800000; }
-pre.sourceCode span.dv { color: #0000FF; }
-pre.sourceCode span.bn { color: #0000FF; }
-pre.sourceCode span.fl { color: #800080; }
-pre.sourceCode span.ch { color: #FF00FF; }
-pre.sourceCode span.st { color: #DD0000; }
-pre.sourceCode span.co { color: #808080; font-style: italic; }
-pre.sourceCode span.ot { }
-pre.sourceCode span.al { color: green; font-weight: bold; }
-pre.sourceCode span.fu { color: #000080; }
-pre.sourceCode span.re { }
-pre.sourceCode span.er { color: red; font-weight: bold; }
+$highlighting-css$
</style>
$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)$
<meta name="date" content="$date$" />
$endif$
-$if(highlighting)$
+$if(highlighting-css)$
<style type="text/css">
-table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode, table.sourceCode pre
- { margin: 0; padding: 0; border: 0; vertical-align: baseline; border: none; }
-td.lineNumbers { text-align: right; background-color: #EBEBEB; color: black; padding-right: 5px; padding-left: 5px; }
-td.sourceCode { padding-left: 5px; }
-pre.sourceCode { }
-pre.sourceCode span.kw { font-weight: bold; }
-pre.sourceCode span.dt { color: #800000; }
-pre.sourceCode span.dv { color: #0000FF; }
-pre.sourceCode span.bn { color: #0000FF; }
-pre.sourceCode span.fl { color: #800080; }
-pre.sourceCode span.ch { color: #FF00FF; }
-pre.sourceCode span.st { color: #DD0000; }
-pre.sourceCode span.co { color: #808080; font-style: italic; }
-pre.sourceCode span.ot { }
-pre.sourceCode span.al { color: green; font-weight: bold; }
-pre.sourceCode span.fu { color: #000080; }
-pre.sourceCode span.re { }
-pre.sourceCode span.er { color: red; font-weight: bold; }
+$highlighting-css$
</style>
$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 @@
<style type="text/css">
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode, table.sourceCode pre
{ margin: 0; padding: 0; border: 0; vertical-align: baseline; border: none; }
-td.lineNumbers { text-align: right; background-color: #EBEBEB; color: black; padding-right: 5px; padding-left: 5px; }
+td.lineNumbers { border-right: 1px solid #AAAAAA; text-align: right; color: #AAAAAA; padding-right: 5px; padding-left: 5px; }
td.sourceCode { padding-left: 5px; }
-pre.sourceCode { }
-pre.sourceCode span.kw { font-weight: bold; }
-pre.sourceCode span.dt { color: #800000; }
-pre.sourceCode span.dv { color: #0000FF; }
-pre.sourceCode span.bn { color: #0000FF; }
-pre.sourceCode span.fl { color: #800080; }
-pre.sourceCode span.ch { color: #FF00FF; }
-pre.sourceCode span.st { color: #DD0000; }
-pre.sourceCode span.co { color: #808080; font-style: italic; }
-pre.sourceCode span.ot { }
-pre.sourceCode span.al { color: green; font-weight: bold; }
-pre.sourceCode span.fu { color: #000080; }
+pre.sourceCode span.kw { color: #007020; font-weight: bold; }
+pre.sourceCode span.dt { color: #902000; }
+pre.sourceCode span.dv { color: #40a070; }
+pre.sourceCode span.bn { color: #40a070; }
+pre.sourceCode span.fl { color: #40a070; }
+pre.sourceCode span.ch { color: #4070a0; }
+pre.sourceCode span.st { color: #4070a0; }
+pre.sourceCode span.co { color: #60a0b0; font-style: italic; }
+pre.sourceCode span.ot { color: #007020; }
+pre.sourceCode span.al { color: red; font-weight: bold; }
+pre.sourceCode span.fu { color: #06287e; }
pre.sourceCode span.re { }
pre.sourceCode span.er { color: red; font-weight: bold; }
</style>
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 @@
<style type="text/css">
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode, table.sourceCode pre
{ margin: 0; padding: 0; border: 0; vertical-align: baseline; border: none; }
-td.lineNumbers { text-align: right; background-color: #EBEBEB; color: black; padding-right: 5px; padding-left: 5px; }
+td.lineNumbers { border-right: 1px solid #AAAAAA; text-align: right; color: #AAAAAA; padding-right: 5px; padding-left: 5px; }
td.sourceCode { padding-left: 5px; }
-pre.sourceCode { }
-pre.sourceCode span.kw { font-weight: bold; }
-pre.sourceCode span.dt { color: #800000; }
-pre.sourceCode span.dv { color: #0000FF; }
-pre.sourceCode span.bn { color: #0000FF; }
-pre.sourceCode span.fl { color: #800080; }
-pre.sourceCode span.ch { color: #FF00FF; }
-pre.sourceCode span.st { color: #DD0000; }
-pre.sourceCode span.co { color: #808080; font-style: italic; }
-pre.sourceCode span.ot { }
-pre.sourceCode span.al { color: green; font-weight: bold; }
-pre.sourceCode span.fu { color: #000080; }
+pre.sourceCode span.kw { color: #007020; font-weight: bold; }
+pre.sourceCode span.dt { color: #902000; }
+pre.sourceCode span.dv { color: #40a070; }
+pre.sourceCode span.bn { color: #40a070; }
+pre.sourceCode span.fl { color: #40a070; }
+pre.sourceCode span.ch { color: #4070a0; }
+pre.sourceCode span.st { color: #4070a0; }
+pre.sourceCode span.co { color: #60a0b0; font-style: italic; }
+pre.sourceCode span.ot { color: #007020; }
+pre.sourceCode span.al { color: red; font-weight: bold; }
+pre.sourceCode span.fu { color: #06287e; }
pre.sourceCode span.re { }
pre.sourceCode span.er { color: red; font-weight: bold; }
</style>