Don't use Dom::Tiny
This commit is contained in:
parent
a06df05580
commit
57ac48e167
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
use paths;
|
use paths;
|
||||||
use File::Temp;
|
use File::Temp;
|
||||||
use DOM::Tiny;
|
|
||||||
use HTML::Lazy (:ALL);
|
use HTML::Lazy (:ALL);
|
||||||
|
|
||||||
my $build-path;
|
my $build-path;
|
||||||
|
@ -21,18 +20,12 @@ body {
|
||||||
|
|
||||||
# Stylize katla output
|
# Stylize katla output
|
||||||
sub 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
|
# Apply regex edits to colorize existing elements
|
||||||
$output =
|
$katla-output.match(/'color: darkgray'/).replace-with('color: #dedede')
|
||||||
$output.match(/'color: darkgray'/).replace-with('color: #dedede')
|
.match(/'color: lightgrey'/).replace-with('color: #777777')
|
||||||
.match(/'color: lightgrey'/).replace-with('color: #777777')
|
.match(/'color: yellow'/).replace-with('color: #3b3b3b')
|
||||||
.match(/'color: yellow'/).replace-with('color: #3b3b3b')
|
.match(/'color: gray'/).replace-with('color: #777777')
|
||||||
.match(/'color: gray'/).replace-with('color: #777777');
|
.match(/'<style>'/).replace-with("<style>\n$background-css")
|
||||||
$output
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Renders the file at the given location to the temporary directory
|
# Renders the file at the given location to the temporary directory
|
||||||
|
@ -75,6 +68,7 @@ my method add-path(%index: $path, $value) {
|
||||||
|
|
||||||
# Render the index to html
|
# Render the index to html
|
||||||
my method render-index(%index:) {
|
my method render-index(%index:) {
|
||||||
|
# TODO sort these properly
|
||||||
my @elements = [];
|
my @elements = [];
|
||||||
for %index.keys -> $key {
|
for %index.keys -> $key {
|
||||||
say "";
|
say "";
|
||||||
|
|
Loading…
Reference in a new issue