diff --git a/src/katla.dhall b/src/katla.dhall deleted file mode 100644 index 19d4d68..0000000 --- a/src/katla.dhall +++ /dev/null @@ -1,23 +0,0 @@ -{ font = "\\ttfamily" -, space = " " -, datacons = { style = "" - , colour = "#ed4a46"} -, typecons = { style = "" - , colour = "#368aeb"} -, bound = { style = "" - , colour = "#dedede"} -, function = { style = "" - , colour = "#70b433"} -, keyword = { style = "font-weight: bold;" - , colour = "#3fc5b7"} -, comment = { style = "" - , colour = "#777777"} -, hole = { style = "font-weight: bold;" - , colour = "#dbb32d" } -, namespce = { style = "font-style: italic;" - , colour = "#dedede"} -, postulte = { style = "font-weight: bold;" - , colour = "#ed4a46"} -, aModule = { style = "font-style: italic;" - , colour = "#dedede"} -} diff --git a/src/upload.raku b/src/upload.raku index 4a4f944..42baff4 100755 --- a/src/upload.raku +++ b/src/upload.raku @@ -2,6 +2,7 @@ use paths; use File::Temp; +use DOM::Tiny; use HTML::Lazy (:ALL); my $build-path; @@ -20,34 +21,34 @@ body { # Stylize katla output sub stylize($katla-output) { + my $dom = DOM::Tiny.parse($katla-output); + # Insert our background css + $dom.find('style')[*-1][*-1].prepend($background-css); + # Undomify + my $output = $dom.Str; # Apply regex edits to colorize existing elements - $katla-output.match(/'color: darkgray'/).replace-with('color: #dedede') - .match(/'color: lightgrey'/).replace-with('color: #777777') - .match(/'color: yellow'/).replace-with('color: #3b3b3b') - .match(/'color: gray'/).replace-with('color: #777777') - .match(/'