commit 9eb1e8e12ff3c68c5e13bb6c17bedf68040ef1ff
parent 096dbdbaa3ac45af3b10663485415024b365d992
Author: Michael Neuper <michael@michaelneuper.com>
Date: Wed, 1 Nov 2023 16:03:59 +0200
Add syntax highlighting to code blocks
Diffstat:
2 files changed, 730 insertions(+), 2 deletions(-)
diff --git a/config.toml b/config.toml
@@ -28,6 +28,12 @@ name = "GitHub"
url = "https://github.com/michaelneuper"
weight = 3
+[[menu.main]]
+identifier = "contact"
+name = "Contact"
+url = "/pages/contact/"
+weight = 4
+
[taxonomies]
tags = "tags"
categories = "categories"
@@ -37,7 +43,7 @@ defaultMarkdownHandler = "goldmark"
[markup.goldmark.renderer]
unsafe= true
[markup.highlight]
-style = "base16-solarized-dark"
+noClasses = false
[markup.tableOfContents]
endLevel = 6
ordered = false
@@ -55,7 +61,7 @@ footnote = """
<a class=link href=/index.xml>RSS</a> -->
"""
keywords = ["michael", "neuper", "linux", "blog", "productivity"]
-customCSS = ["css/styles.css"]
+customCSS = ["css/styles.css", "css/syntax.css"]
customJS = ["js/script.js"]
dateFormat = "2 January 2006"
emphasisWithDots = true
diff --git a/static/css/syntax.css b/static/css/syntax.css
@@ -0,0 +1,722 @@
+@media (prefers-color-scheme: dark) {
+ /* Background */
+ .bg {
+ color: #93a1a1;
+ background-color: #002b36;
+ }
+ /* PreWrapper */
+ .chroma {
+ color: #93a1a1;
+ background-color: #002b36;
+ }
+ /* Other */
+ .chroma .x {
+ color: #cb4b16;
+ }
+ /* Error */
+ .chroma .err {
+ }
+ /* CodeLine */
+ .chroma .cl {
+ }
+ /* LineLink */
+ .chroma .lnlinks {
+ outline: none;
+ text-decoration: none;
+ color: inherit;
+ }
+ /* LineTableTD */
+ .chroma .lntd {
+ vertical-align: top;
+ padding: 0;
+ margin: 0;
+ border: 0;
+ }
+ /* LineTable */
+ .chroma .lntable {
+ border-spacing: 0;
+ padding: 0;
+ margin: 0;
+ border: 0;
+ }
+ /* LineHighlight */
+ .chroma .hl {
+ background-color: #19404a;
+ }
+ /* LineNumbersTable */
+ .chroma .lnt {
+ white-space: pre;
+ -webkit-user-select: none;
+ user-select: none;
+ margin-right: 0.4em;
+ padding: 0 0.4em 0 0.4em;
+ color: #495050;
+ }
+ /* LineNumbers */
+ .chroma .ln {
+ white-space: pre;
+ -webkit-user-select: none;
+ user-select: none;
+ margin-right: 0.4em;
+ padding: 0 0.4em 0 0.4em;
+ color: #495050;
+ }
+ /* Line */
+ .chroma .line {
+ display: flex;
+ }
+ /* Keyword */
+ .chroma .k {
+ color: #719e07;
+ }
+ /* KeywordConstant */
+ .chroma .kc {
+ color: #cb4b16;
+ }
+ /* KeywordDeclaration */
+ .chroma .kd {
+ color: #268bd2;
+ }
+ /* KeywordNamespace */
+ .chroma .kn {
+ color: #719e07;
+ }
+ /* KeywordPseudo */
+ .chroma .kp {
+ color: #719e07;
+ }
+ /* KeywordReserved */
+ .chroma .kr {
+ color: #268bd2;
+ }
+ /* KeywordType */
+ .chroma .kt {
+ color: #dc322f;
+ }
+ /* Name */
+ .chroma .n {
+ }
+ /* NameAttribute */
+ .chroma .na {
+ }
+ /* NameBuiltin */
+ .chroma .nb {
+ color: #b58900;
+ }
+ /* NameBuiltinPseudo */
+ .chroma .bp {
+ color: #268bd2;
+ }
+ /* NameClass */
+ .chroma .nc {
+ color: #268bd2;
+ }
+ /* NameConstant */
+ .chroma .no {
+ color: #cb4b16;
+ }
+ /* NameDecorator */
+ .chroma .nd {
+ color: #268bd2;
+ }
+ /* NameEntity */
+ .chroma .ni {
+ color: #cb4b16;
+ }
+ /* NameException */
+ .chroma .ne {
+ color: #cb4b16;
+ }
+ /* NameFunction */
+ .chroma .nf {
+ color: #268bd2;
+ }
+ /* NameFunctionMagic */
+ .chroma .fm {
+ }
+ /* NameLabel */
+ .chroma .nl {
+ }
+ /* NameNamespace */
+ .chroma .nn {
+ }
+ /* NameOther */
+ .chroma .nx {
+ }
+ /* NameProperty */
+ .chroma .py {
+ }
+ /* NameTag */
+ .chroma .nt {
+ color: #268bd2;
+ }
+ /* NameVariable */
+ .chroma .nv {
+ color: #268bd2;
+ }
+ /* NameVariableClass */
+ .chroma .vc {
+ }
+ /* NameVariableGlobal */
+ .chroma .vg {
+ }
+ /* NameVariableInstance */
+ .chroma .vi {
+ }
+ /* NameVariableMagic */
+ .chroma .vm {
+ }
+ /* Literal */
+ .chroma .l {
+ }
+ /* LiteralDate */
+ .chroma .ld {
+ }
+ /* LiteralString */
+ .chroma .s {
+ color: #2aa198;
+ }
+ /* LiteralStringAffix */
+ .chroma .sa {
+ color: #2aa198;
+ }
+ /* LiteralStringBacktick */
+ .chroma .sb {
+ color: #586e75;
+ }
+ /* LiteralStringChar */
+ .chroma .sc {
+ color: #2aa198;
+ }
+ /* LiteralStringDelimiter */
+ .chroma .dl {
+ color: #2aa198;
+ }
+ /* LiteralStringDoc */
+ .chroma .sd {
+ }
+ /* LiteralStringDouble */
+ .chroma .s2 {
+ color: #2aa198;
+ }
+ /* LiteralStringEscape */
+ .chroma .se {
+ color: #cb4b16;
+ }
+ /* LiteralStringHeredoc */
+ .chroma .sh {
+ }
+ /* LiteralStringInterpol */
+ .chroma .si {
+ color: #2aa198;
+ }
+ /* LiteralStringOther */
+ .chroma .sx {
+ color: #2aa198;
+ }
+ /* LiteralStringRegex */
+ .chroma .sr {
+ color: #dc322f;
+ }
+ /* LiteralStringSingle */
+ .chroma .s1 {
+ color: #2aa198;
+ }
+ /* LiteralStringSymbol */
+ .chroma .ss {
+ color: #2aa198;
+ }
+ /* LiteralNumber */
+ .chroma .m {
+ color: #2aa198;
+ }
+ /* LiteralNumberBin */
+ .chroma .mb {
+ color: #2aa198;
+ }
+ /* LiteralNumberFloat */
+ .chroma .mf {
+ color: #2aa198;
+ }
+ /* LiteralNumberHex */
+ .chroma .mh {
+ color: #2aa198;
+ }
+ /* LiteralNumberInteger */
+ .chroma .mi {
+ color: #2aa198;
+ }
+ /* LiteralNumberIntegerLong */
+ .chroma .il {
+ color: #2aa198;
+ }
+ /* LiteralNumberOct */
+ .chroma .mo {
+ color: #2aa198;
+ }
+ /* Operator */
+ .chroma .o {
+ color: #719e07;
+ }
+ /* OperatorWord */
+ .chroma .ow {
+ color: #719e07;
+ }
+ /* Punctuation */
+ .chroma .p {
+ }
+ /* Comment */
+ .chroma .c {
+ color: #586e75;
+ }
+ /* CommentHashbang */
+ .chroma .ch {
+ color: #586e75;
+ }
+ /* CommentMultiline */
+ .chroma .cm {
+ color: #586e75;
+ }
+ /* CommentSingle */
+ .chroma .c1 {
+ color: #586e75;
+ }
+ /* CommentSpecial */
+ .chroma .cs {
+ color: #719e07;
+ }
+ /* CommentPreproc */
+ .chroma .cp {
+ color: #719e07;
+ }
+ /* CommentPreprocFile */
+ .chroma .cpf {
+ color: #719e07;
+ }
+ /* Generic */
+ .chroma .g {
+ }
+ /* GenericDeleted */
+ .chroma .gd {
+ color: #dc322f;
+ }
+ /* GenericEmph */
+ .chroma .ge {
+ font-style: italic;
+ }
+ /* GenericError */
+ .chroma .gr {
+ color: #dc322f;
+ font-weight: bold;
+ }
+ /* GenericHeading */
+ .chroma .gh {
+ color: #cb4b16;
+ }
+ /* GenericInserted */
+ .chroma .gi {
+ color: #719e07;
+ }
+ /* GenericOutput */
+ .chroma .go {
+ }
+ /* GenericPrompt */
+ .chroma .gp {
+ }
+ /* GenericStrong */
+ .chroma .gs {
+ font-weight: bold;
+ }
+ /* GenericSubheading */
+ .chroma .gu {
+ color: #268bd2;
+ }
+ /* GenericTraceback */
+ .chroma .gt {
+ }
+ /* GenericUnderline */
+ .chroma .gl {
+ }
+ /* TextWhitespace */
+ .chroma .w {
+ }
+}
+
+@media (prefers-color-scheme: light) {
+ /* Background */
+ .bg {
+ color: #586e75;
+ background-color: #eee8d5;
+ }
+ /* PreWrapper */
+ .chroma {
+ color: #586e75;
+ background-color: #eee8d5;
+ }
+ /* Other */
+ .chroma .x {
+ }
+ /* Error */
+ .chroma .err {
+ }
+ /* CodeLine */
+ .chroma .cl {
+ }
+ /* LineLink */
+ .chroma .lnlinks {
+ outline: none;
+ text-decoration: none;
+ color: inherit;
+ }
+ /* LineTableTD */
+ .chroma .lntd {
+ vertical-align: top;
+ padding: 0;
+ margin: 0;
+ border: 0;
+ }
+ /* LineTable */
+ .chroma .lntable {
+ border-spacing: 0;
+ padding: 0;
+ margin: 0;
+ border: 0;
+ }
+ /* LineHighlight */
+ .chroma .hl {
+ background-color: #d6d0bf;
+ }
+ /* LineNumbersTable */
+ .chroma .lnt {
+ white-space: pre;
+ -webkit-user-select: none;
+ user-select: none;
+ margin-right: 0.4em;
+ padding: 0 0.4em 0 0.4em;
+ color: #7f7f7f;
+ }
+ /* LineNumbers */
+ .chroma .ln {
+ white-space: pre;
+ -webkit-user-select: none;
+ user-select: none;
+ margin-right: 0.4em;
+ padding: 0 0.4em 0 0.4em;
+ color: #7f7f7f;
+ }
+ /* Line */
+ .chroma .line {
+ display: flex;
+ }
+ /* Keyword */
+ .chroma .k {
+ color: #859900;
+ }
+ /* KeywordConstant */
+ .chroma .kc {
+ color: #859900;
+ font-weight: bold;
+ }
+ /* KeywordDeclaration */
+ .chroma .kd {
+ color: #859900;
+ }
+ /* KeywordNamespace */
+ .chroma .kn {
+ color: #dc322f;
+ font-weight: bold;
+ }
+ /* KeywordPseudo */
+ .chroma .kp {
+ color: #859900;
+ }
+ /* KeywordReserved */
+ .chroma .kr {
+ color: #859900;
+ }
+ /* KeywordType */
+ .chroma .kt {
+ color: #859900;
+ font-weight: bold;
+ }
+ /* Name */
+ .chroma .n {
+ color: #268bd2;
+ }
+ /* NameAttribute */
+ .chroma .na {
+ color: #268bd2;
+ }
+ /* NameBuiltin */
+ .chroma .nb {
+ color: #cb4b16;
+ }
+ /* NameBuiltinPseudo */
+ .chroma .bp {
+ color: #268bd2;
+ }
+ /* NameClass */
+ .chroma .nc {
+ color: #cb4b16;
+ }
+ /* NameConstant */
+ .chroma .no {
+ color: #268bd2;
+ }
+ /* NameDecorator */
+ .chroma .nd {
+ color: #268bd2;
+ }
+ /* NameEntity */
+ .chroma .ni {
+ color: #268bd2;
+ }
+ /* NameException */
+ .chroma .ne {
+ color: #268bd2;
+ }
+ /* NameFunction */
+ .chroma .nf {
+ color: #268bd2;
+ }
+ /* NameFunctionMagic */
+ .chroma .fm {
+ color: #268bd2;
+ }
+ /* NameLabel */
+ .chroma .nl {
+ color: #268bd2;
+ }
+ /* NameNamespace */
+ .chroma .nn {
+ color: #268bd2;
+ }
+ /* NameOther */
+ .chroma .nx {
+ color: #268bd2;
+ }
+ /* NameProperty */
+ .chroma .py {
+ color: #268bd2;
+ }
+ /* NameTag */
+ .chroma .nt {
+ color: #268bd2;
+ font-weight: bold;
+ }
+ /* NameVariable */
+ .chroma .nv {
+ color: #268bd2;
+ }
+ /* NameVariableClass */
+ .chroma .vc {
+ color: #268bd2;
+ }
+ /* NameVariableGlobal */
+ .chroma .vg {
+ color: #268bd2;
+ }
+ /* NameVariableInstance */
+ .chroma .vi {
+ color: #268bd2;
+ }
+ /* NameVariableMagic */
+ .chroma .vm {
+ color: #268bd2;
+ }
+ /* Literal */
+ .chroma .l {
+ color: #2aa198;
+ }
+ /* LiteralDate */
+ .chroma .ld {
+ color: #2aa198;
+ }
+ /* LiteralString */
+ .chroma .s {
+ color: #2aa198;
+ }
+ /* LiteralStringAffix */
+ .chroma .sa {
+ color: #2aa198;
+ }
+ /* LiteralStringBacktick */
+ .chroma .sb {
+ color: #2aa198;
+ }
+ /* LiteralStringChar */
+ .chroma .sc {
+ color: #2aa198;
+ }
+ /* LiteralStringDelimiter */
+ .chroma .dl {
+ color: #2aa198;
+ }
+ /* LiteralStringDoc */
+ .chroma .sd {
+ color: #2aa198;
+ }
+ /* LiteralStringDouble */
+ .chroma .s2 {
+ color: #2aa198;
+ }
+ /* LiteralStringEscape */
+ .chroma .se {
+ color: #2aa198;
+ }
+ /* LiteralStringHeredoc */
+ .chroma .sh {
+ color: #2aa198;
+ }
+ /* LiteralStringInterpol */
+ .chroma .si {
+ color: #2aa198;
+ }
+ /* LiteralStringOther */
+ .chroma .sx {
+ color: #2aa198;
+ }
+ /* LiteralStringRegex */
+ .chroma .sr {
+ color: #2aa198;
+ }
+ /* LiteralStringSingle */
+ .chroma .s1 {
+ color: #2aa198;
+ }
+ /* LiteralStringSymbol */
+ .chroma .ss {
+ color: #2aa198;
+ }
+ /* LiteralNumber */
+ .chroma .m {
+ color: #2aa198;
+ font-weight: bold;
+ }
+ /* LiteralNumberBin */
+ .chroma .mb {
+ color: #2aa198;
+ font-weight: bold;
+ }
+ /* LiteralNumberFloat */
+ .chroma .mf {
+ color: #2aa198;
+ font-weight: bold;
+ }
+ /* LiteralNumberHex */
+ .chroma .mh {
+ color: #2aa198;
+ font-weight: bold;
+ }
+ /* LiteralNumberInteger */
+ .chroma .mi {
+ color: #2aa198;
+ font-weight: bold;
+ }
+ /* LiteralNumberIntegerLong */
+ .chroma .il {
+ color: #2aa198;
+ font-weight: bold;
+ }
+ /* LiteralNumberOct */
+ .chroma .mo {
+ color: #2aa198;
+ font-weight: bold;
+ }
+ /* Operator */
+ .chroma .o {
+ }
+ /* OperatorWord */
+ .chroma .ow {
+ color: #859900;
+ }
+ /* Punctuation */
+ .chroma .p {
+ }
+ /* Comment */
+ .chroma .c {
+ color: #93a1a1;
+ font-style: italic;
+ }
+ /* CommentHashbang */
+ .chroma .ch {
+ color: #93a1a1;
+ font-style: italic;
+ }
+ /* CommentMultiline */
+ .chroma .cm {
+ color: #93a1a1;
+ font-style: italic;
+ }
+ /* CommentSingle */
+ .chroma .c1 {
+ color: #93a1a1;
+ font-style: italic;
+ }
+ /* CommentSpecial */
+ .chroma .cs {
+ color: #93a1a1;
+ font-style: italic;
+ }
+ /* CommentPreproc */
+ .chroma .cp {
+ color: #93a1a1;
+ font-style: italic;
+ }
+ /* CommentPreprocFile */
+ .chroma .cpf {
+ color: #93a1a1;
+ font-style: italic;
+ }
+ /* Generic */
+ .chroma .g {
+ color: #d33682;
+ }
+ /* GenericDeleted */
+ .chroma .gd {
+ color: #d33682;
+ }
+ /* GenericEmph */
+ .chroma .ge {
+ color: #d33682;
+ }
+ /* GenericError */
+ .chroma .gr {
+ color: #d33682;
+ }
+ /* GenericHeading */
+ .chroma .gh {
+ color: #d33682;
+ }
+ /* GenericInserted */
+ .chroma .gi {
+ color: #d33682;
+ }
+ /* GenericOutput */
+ .chroma .go {
+ color: #d33682;
+ }
+ /* GenericPrompt */
+ .chroma .gp {
+ color: #d33682;
+ }
+ /* GenericStrong */
+ .chroma .gs {
+ color: #d33682;
+ }
+ /* GenericSubheading */
+ .chroma .gu {
+ color: #d33682;
+ }
+ /* GenericTraceback */
+ .chroma .gt {
+ color: #d33682;
+ }
+ /* GenericUnderline */
+ .chroma .gl {
+ color: #d33682;
+ }
+ /* TextWhitespace */
+ .chroma .w {
+ }
+}