From: Marco Otte-Witte Date: Tue, 20 Aug 2024 15:37:33 +0000 (+0200) Subject: custom syntax highlighting X-Git-Url: http://git.euphorik.ch/?a=commitdiff_plain;h=1b050774e76aeed34c0361829d660f8e8a17045f;p=rust_exercises.git custom syntax highlighting --- diff --git a/book/book.toml b/book/book.toml index ae209cb..c6461ad 100644 --- a/book/book.toml +++ b/book/book.toml @@ -51,7 +51,6 @@ sansfontfallback = ["Noto Color Emoji:mode=harf"] monofontfallback = [ "Noto Color Emoji:mode=harf", ] -monobackgroundcolor = "\\color[HTML]{e7e7e7}" linkcolor = "Links" urlcolor = "Links" linkstyle = "bold" @@ -64,6 +63,7 @@ header-includes = [ # Reduce font size of code blocks "\\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\\\\{\\},fontsize=\\small}", ] +highlight-style = "book/custom.theme" [output.pandoc.profile.paperback] output-file = "100-exercises-to-learn-rust.pdf" diff --git a/book/custom.theme b/book/custom.theme new file mode 100644 index 0000000..82d9692 --- /dev/null +++ b/book/custom.theme @@ -0,0 +1,211 @@ +{ + "text-color": "#c9d1d9", + "background-color": "#343942", + "line-number-color": null, + "line-number-background-color": null, + "text-styles": { + "Alert": { + "text-color": "#ff0000", + "background-color": null, + "bold": true, + "italic": false, + "underline": false + }, + "Annotation": { + "text-color": "#8b949e", + "background-color": null, + "bold": true, + "italic": true, + "underline": false + }, + "Attribute": { + "text-color": "#03DAC5", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "BaseN": { + "text-color": "#03DAC5", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "BuiltIn": { + "text-color": "#03DAC5", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Char": { + "text-color": "#03DAC5", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Comment": { + "text-color": "#8b949e", + "background-color": null, + "bold": false, + "italic": true, + "underline": false + }, + "CommentVar": { + "text-color": "#8b949e", + "background-color": null, + "bold": true, + "italic": true, + "underline": false + }, + "Constant": { + "text-color": "#79c0ff", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "ControlFlow": { + "text-color": "#03DAC5", + "background-color": null, + "bold": true, + "italic": false, + "underline": false + }, + "DataType": { + "text-color": "#8b949e", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "DecVal": { + "text-color": "#79c0ff", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Documentation": { + "text-color": "#8b949e", + "background-color": null, + "bold": false, + "italic": true, + "underline": false + }, + "Error": { + "text-color": "#ff0000", + "background-color": null, + "bold": true, + "italic": false, + "underline": false + }, + "Extension": { + "text-color": null, + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Float": { + "text-color": "#79c0ff", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Function": { + "text-color": "#d2a8ff", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Import": { + "text-color": "#8b949e", + "background-color": null, + "bold": true, + "italic": false, + "underline": false + }, + "Information": { + "text-color": "#8b949e", + "background-color": null, + "bold": true, + "italic": true, + "underline": false + }, + "Keyword": { + "text-color": "#03DAC5", + "background-color": null, + "bold": true, + "italic": false, + "underline": false + }, + "Operator": { + "text-color": "#03DAC5", + "background-color": "#161b22", + "bold": false, + "italic": false, + "underline": false + }, + "Other": { + "text-color": "#007020", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Preprocessor": { + "text-color": "#03DAC5", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "SpecialChar": { + "text-color": "#03DAC5", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "SpecialString": { + "text-color": "#03DAC5", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "String": { + "text-color": "#03DAC5", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Variable": { + "text-color": "#a8daff", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "VerbatimString": { + "text-color": "#03DAC5", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Warning": { + "text-color": "#60a0b0", + "background-color": null, + "bold": true, + "italic": true, + "underline": false + } + } +}