From 8c92c57faac2be19b8c147a668e979f1e0fd9046 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Mon, 18 Mar 2024 00:33:28 -0400 Subject: [PATCH] Use pandoc-generated source code highlighting CSS I previously included hard-coded CSS. Pandoc will apparently generate what is needed for the page, but I didn't have that included in my template. I chose Tango out of a nearly 20y personal preference now, ever since I used the Tango Icon Theme in Ubunutu Dapper Drake (6.06), my introducing to GNOME/GTK. I might have used Breezy, too, I don't recall. Prior to that I think I used Mandrake (before it was Mandriva), which was the first distro I tried, after my laptop's HDD died and I was awaiting a replacement (couldn't run Windows without a HDD). ...anyway. --- src/pandoc.tpl | 5 +++++ src/post2html | 1 + style.css | 33 --------------------------------- 3 files changed, 6 insertions(+), 33 deletions(-) diff --git a/src/pandoc.tpl b/src/pandoc.tpl index c8deb96..d1f6f65 100644 --- a/src/pandoc.tpl +++ b/src/pandoc.tpl @@ -22,6 +22,11 @@ $if(tags)$ $endif$ + + $for(include-after)$ $include-after$ diff --git a/src/post2html b/src/post2html index 7fca77d..c0c6c03 100755 --- a/src/post2html +++ b/src/post2html @@ -136,6 +136,7 @@ main() --standalone --template src/pandoc.tpl \ --metadata pagetitle:ignoreme \ --wrap none \ + --highlight-style tango \ -B <( src/mkheader post @__PAGE_TITLE__@ ) \ -A src/footer.tpl.htm \ < <( prefmt < "$file" ) \ diff --git a/style.css b/style.css index fcbda88..070d168 100644 --- a/style.css +++ b/style.css @@ -786,39 +786,6 @@ footer .site-nav > nav > ul > li a { } } -/*** https://github.com/jgm/highlighting-kate/blob/master/css/hk-tango.css ***/ -/* GNU GPLv2 */ -/* Loosely based on pygment's tango colors */ -/* Modified where indicated by Mike Gerwitz */ -table.sourceCode, tr.sourceCode, td.sourceCode, table.sourceCode pre -{ margin: 0; padding: 0; border: 0; vertical-align: baseline; border: none; background-color: #f8f8f8 } -td.nums { text-align: right; padding-right: 5px; padding-left: 5px; background-color: #f0f0f0; } -td.sourceCode { padding-left: 5px; } -code.sourceCode { background-color: #f8f8f8; } -pre.sourceCode { - /* modified by Mike Gerwitz */ - padding: 1em; - margin: 0 -1em; - - background-color: #f8f8f8; - line-height: 125% -} -td.nums pre { background-color: #f0f0f0; line-height: 125% } -code.sourceCode span.kw { color: #204a87; font-weight: bold } /* Keyword */ -code.sourceCode span.dt { color: #204a87 } /* Keyword.Type */ -code.sourceCode span.dv { color: #0000cf } /* Literal.Number.Integer */ -code.sourceCode span.bn { color: #0000cf } /* Literal.Number.Hex */ -code.sourceCode span.fl { color: #0000cf } /* Literal.Number.Float */ -code.sourceCode span.ch { color: #4e9a06 } /* Literal.String.Char */ -code.sourceCode span.st { color: #4e9a06 } /* Literal.String */ -code.sourceCode span.co { color: #8f5902; font-style: italic } /* Comment */ -code.sourceCode span.ot { color: #8f5902 } /* Comment.Preproc */ -code.sourceCode span.al { color: #ef2929 } /* Generic.Error */ -code.sourceCode span.fu { color: #000000 } /* Name.Function */ -code.sourceCode span.re { } -code.sourceCode span.er { color: #a40000; border: 1px solid #ef2929 } /* Error */ - - /* Finally, the perpetual pain in my ass as a web developer: IE. IE11 is * the only version I attempt here, enough to make it presentable and warn * the user. */