From bb362fd76c94cb5228b06632c47993ee48cecac4 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 4 Sep 2019 17:33:59 -0700 Subject: Add partial styles.html in HTML5 template. Avoid duplication in HTML templates by using styles.html partial. Change indentation of styles in template. --- cabal.project | 5 ++ data/templates/default.dzslides | 13 +--- data/templates/default.html4 | 13 +--- data/templates/default.html5 | 13 +--- data/templates/default.revealjs | 13 +--- data/templates/default.s5 | 13 +--- data/templates/default.slideous | 13 +--- data/templates/default.slidy | 13 +--- data/templates/styles.html | 11 ++++ pandoc.cabal | 1 + stack.yaml | 4 +- test/lhs-test.html | 134 ++++++++++++++++++++-------------------- test/lhs-test.html+lhs | 134 ++++++++++++++++++++-------------------- test/s5-basic.html | 8 +-- test/s5-fancy.html | 8 +-- test/s5-inserts.html | 8 +-- test/writer.html4 | 8 +-- test/writer.html5 | 8 +-- 18 files changed, 179 insertions(+), 241 deletions(-) create mode 100644 data/templates/styles.html diff --git a/cabal.project b/cabal.project index a62cb2293..93439ca3e 100644 --- a/cabal.project +++ b/cabal.project @@ -12,3 +12,8 @@ source-repository-package type: git location: https://github.com/jgm/pandoc-citeproc tag: 63498fb22ae6f394f19f6d62312350b566c4aebd + +source-repository-package + type: git + location: https://github.com/jgm/doctemplates + tag: 37ac859e3c88493ac62ce5f9e32a943d37529b98 diff --git a/data/templates/default.dzslides b/data/templates/default.dzslides index 96862a2fd..11103ab81 100644 --- a/data/templates/default.dzslides +++ b/data/templates/default.dzslides @@ -13,19 +13,8 @@ $if(keywords)$ $endif$ $if(title-prefix)$$title-prefix$ – $endif$$pagetitle$ -$if(highlighting-css)$ - -$endif$ $if(css)$ $for(css)$ diff --git a/data/templates/default.html4 b/data/templates/default.html4 index 714b3ff2e..5f9b43e47 100644 --- a/data/templates/default.html4 +++ b/data/templates/default.html4 @@ -15,19 +15,8 @@ $if(keywords)$ $endif$ $if(title-prefix)$$title-prefix$ – $endif$$pagetitle$ -$if(highlighting-css)$ - -$endif$ $for(css)$ $endfor$ diff --git a/data/templates/default.html5 b/data/templates/default.html5 index 9816fcf9f..eff6e73ab 100644 --- a/data/templates/default.html5 +++ b/data/templates/default.html5 @@ -15,19 +15,8 @@ $if(keywords)$ $endif$ $if(title-prefix)$$title-prefix$ – $endif$$pagetitle$ -$if(highlighting-css)$ - -$endif$ $for(css)$ $endfor$ diff --git a/data/templates/default.revealjs b/data/templates/default.revealjs index 8e461502d..f63fc144e 100644 --- a/data/templates/default.revealjs +++ b/data/templates/default.revealjs @@ -19,19 +19,8 @@ $endif$ -$if(highlighting-css)$ - -$endif$ $if(theme)$ $else$ diff --git a/data/templates/default.s5 b/data/templates/default.s5 index e9c36b4d4..d76111284 100644 --- a/data/templates/default.s5 +++ b/data/templates/default.s5 @@ -16,22 +16,11 @@ $if(keywords)$ $endif$ $if(title-prefix)$$title-prefix$ – $endif$$pagetitle$ -$if(highlighting-css)$ - -$endif$ $for(css)$ $endfor$ diff --git a/data/templates/default.slideous b/data/templates/default.slideous index ad58272ae..ebf582dca 100644 --- a/data/templates/default.slideous +++ b/data/templates/default.slideous @@ -17,19 +17,8 @@ $if(keywords)$ $endif$ $if(title-prefix)$$title-prefix$ – $endif$$pagetitle$ -$if(highlighting-css)$ - -$endif$ $for(css)$ diff --git a/data/templates/default.slidy b/data/templates/default.slidy index 98b8d669d..6b9776858 100644 --- a/data/templates/default.slidy +++ b/data/templates/default.slidy @@ -17,19 +17,8 @@ $if(keywords)$ $endif$ $if(title-prefix)$$title-prefix$ – $endif$$pagetitle$ -$if(highlighting-css)$ - -$endif$ $for(css)$ diff --git a/data/templates/styles.html b/data/templates/styles.html new file mode 100644 index 000000000..866896549 --- /dev/null +++ b/data/templates/styles.html @@ -0,0 +1,11 @@ +code{white-space: pre-wrap;} +span.smallcaps{font-variant: small-caps;} +span.underline{text-decoration: underline;} +div.column{display: inline-block; vertical-align: top; width: 50%;} +$if(quotes)$ +q { quotes: "“" "”" "‘" "’"; } +$endif$ +$if(highlighting-css)$ +$highlighting-css$ +$endif$ + diff --git a/pandoc.cabal b/pandoc.cabal index 5627ae5a6..89e140465 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -41,6 +41,7 @@ description: Pandoc is a Haskell library for converting from one markup only adding a reader or writer. data-files: -- templates + data/templates/styles.html data/templates/default.html4 data/templates/default.html5 data/templates/default.docbook4 diff --git a/stack.yaml b/stack.yaml index 31187b194..2c585cf4f 100644 --- a/stack.yaml +++ b/stack.yaml @@ -14,6 +14,8 @@ extra-deps: # - pandoc-citeproc-0.16.2 - git: https://github.com/jgm/pandoc-citeproc commit: 63498fb22ae6f394f19f6d62312350b566c4aebd +- git: https://github.com/jgm/doctemplates + commit: 37ac859e3c88493ac62ce5f9e32a943d37529b98 - pandoc-types-1.17.6 - ipynb-0.1 - cmark-gfm-0.2.0 @@ -23,7 +25,7 @@ extra-deps: - skylighting-core-0.8.2 - skylighting-0.8.2 - doclayout-0.1 -- doctemplates-0.6 + #- doctemplates-0.6 ghc-options: "$locals": -fhide-source-paths -Wno-missing-home-modules resolver: lts-13.17 diff --git a/test/lhs-test.html b/test/lhs-test.html index 446dd3d95..86206d94c 100644 --- a/test/lhs-test.html +++ b/test/lhs-test.html @@ -6,74 +6,72 @@ lhs-test - diff --git a/test/s5-fancy.html b/test/s5-fancy.html index b326f9872..081d5fd06 100644 --- a/test/s5-fancy.html +++ b/test/s5-fancy.html @@ -11,10 +11,10 @@ My S5 Document diff --git a/test/s5-inserts.html b/test/s5-inserts.html index efde179d2..80664a6e2 100644 --- a/test/s5-inserts.html +++ b/test/s5-inserts.html @@ -9,10 +9,10 @@ My S5 Document STUFF INSERTED diff --git a/test/writer.html4 b/test/writer.html4 index 96e8a7979..d1724dce4 100644 --- a/test/writer.html4 +++ b/test/writer.html4 @@ -9,10 +9,10 @@ Pandoc Test Suite diff --git a/test/writer.html5 b/test/writer.html5 index d26b83d9b..9edef5131 100644 --- a/test/writer.html5 +++ b/test/writer.html5 @@ -9,10 +9,10 @@ Pandoc Test Suite