1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-22 16:33:00 +00:00

Add output_classes property to external renderer, and new .invert-when-dark class in theme

ABC Notation & Server-Side Latex look good naow! :D
This commit is contained in:
Starbeamrainbowlabs 2019-10-25 12:12:57 +01:00
parent 6d683533f5
commit f044d25f7e
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
4 changed files with 40 additions and 34 deletions

View file

@ -337,7 +337,7 @@
"version": "0.10", "version": "0.10",
"author": "Emanuil Rusev & Starbeamrainbowlabs", "author": "Emanuil Rusev & Starbeamrainbowlabs",
"description": "An upgraded (now default!) parser based on Emanuil Rusev's Parsedown Extra PHP library (https:\/\/github.com\/erusev\/parsedown-extra), which is licensed MIT. Please be careful, as this module adds some weight to your installation.", "description": "An upgraded (now default!) parser based on Emanuil Rusev's Parsedown Extra PHP library (https:\/\/github.com\/erusev\/parsedown-extra), which is licensed MIT. Please be careful, as this module adds some weight to your installation.",
"lastupdate": 1571958901, "lastupdate": 1572001815,
"optional": false, "optional": false,
"extra_data": { "extra_data": {
"Parsedown.php": "https:\/\/raw.githubusercontent.com\/erusev\/parsedown\/fe7a50eceb4a3c867cc9fa9c0aa906b1067d1955\/Parsedown.php", "Parsedown.php": "https:\/\/raw.githubusercontent.com\/erusev\/parsedown\/fe7a50eceb4a3c867cc9fa9c0aa906b1067d1955\/Parsedown.php",

View file

@ -1012,10 +1012,12 @@ class PeppermintParsedown extends ParsedownExtreme
"name" => "img", "name" => "img",
"attributes" => [ "attributes" => [
"alt" => "Diagram rendered by {$renderer->name}", "alt" => "Diagram rendered by {$renderer->name}",
"src" => "?action=parsedown-render-ext&language=$language&immutable_key=".hash("crc32b", json_encode($renderer))."&source=".rawurlencode($text) "src" => "?action=parsedown-render-ext&language=".rawurlencode($language)."&immutable_key=".hash("crc32b", json_encode($renderer))."&source=".rawurlencode($text)
] ]
] ]
]; ];
if(!empty($renderer->output_classes))
$result["element"]["element"]["attributes"]["class"] = implode(" ", $renderer->output_classes);
return $result; return $result;
} }

View file

@ -26,34 +26,36 @@
"nomnoml": { "nomnoml": {
"name": "nomnoml", "name": "nomnoml",
"description": "The nomnoml UML diagram renderer. Requires the 'nomnoml' npm package to be globally installed.", "description": "The nomnoml UML diagram renderer. Requires the 'nomnoml' npm package to be globally installed.",
"url": "http://nomnoml.com/", "url": "http:\/\/nomnoml.com\/",
"cli": "nomnoml {input_file} {output_file} 0", "cli": "nomnoml {input_file} {output_file} 0",
"cli_mode": "file", "cli_mode": "file",
"output_format": "image/svg+xml" "output_format": "image\/svg+xml"
}, },
"plantuml": { "plantuml": {
"name": "PlantUML", "name": "PlantUML",
"description": "The PlantUML diagram renderer. Supports many different diagram types. Requires plantuml to be installed.", "description": "The PlantUML diagram renderer. Supports many different diagram types. Requires plantuml to be installed.",
"url": "http://plantuml.com/", "url": "http:\/\/plantuml.com\/",
"cli": "plantuml -tsvg -pipe", "cli": "plantuml -tsvg -pipe",
"cli_mode": "pipe", "cli_mode": "pipe",
"output_format": "image/svg+xml" "output_format": "image\/svg+xml"
}, },
"abc": { "abc": {
"name": "ABC Notation", "name": "ABC Notation",
"description": "A simple music notation typesetter. Much easier to understand than Lilypond. Requires abcm2ps to be installed.", "description": "A simple music notation typesetter. Much easier to understand than Lilypond. Requires abcm2ps to be installed.",
"url": "https://abcnotation.com/", "url": "https:\/\/abcnotation.com\/",
"cli": "abcm2ps -g -O - -", "cli": "abcm2ps -g -O - -",
"cli_mode": "pipe", "cli_mode": "pipe",
"output_format": "image/svg+xml" "output_format": "image\/svg+xml",
"output_classes": [ "invert-when-dark" ]
}, },
"latexserver": { "latexserver": {
"name": "Server-Side MathJax", "name": "Server-Side MathJax",
"description": "Client-side Mathjax via the 'enable_math_rendering' setting not your thing? Try it server-side instead! Requires the 'mathjax-node-cli' npm package to be globally installed.", "description": "Client-side Mathjax via the 'enable_math_rendering' setting not your thing? Try it server-side instead! Requires the 'mathjax-node-cli' npm package to be globally installed.",
"url": "https://github.com/mathjax/mathjax-node-cli/blob/master/package.json#L41", "url": "https:\/\/github.com\/mathjax\/mathjax-node-cli\/blob\/master\/package.json#L41",
"cli": "tex2svg -- {input_text}", "cli": "tex2svg -- {input_text}",
"cli_mode": "substitution_pipe", "cli_mode": "substitution_pipe",
"output_format": "image/svg+xml" "output_format": "image\/svg+xml",
"output_classes": [ "invert-when-dark" ]
} }
} }, } },
"parser_ext_time_limit": { "type": "number", "description": "The number of seconds external renderers are allowed to run for. Has no effect if external renderers are turned off. Also currently has no effect on Windows.", "default": 5 }, "parser_ext_time_limit": { "type": "number", "description": "The number of seconds external renderers are allowed to run for. Has no effect if external renderers are turned off. Also currently has no effect on Windows.", "default": 5 },

View file

@ -95,6 +95,8 @@
a:hover { color: hsl(214, 67%, 75%); } a:hover { color: hsl(214, 67%, 75%); }
a:active, a:focus { color: hsl(214, 87%, 85%); } a:active, a:focus { color: hsl(214, 87%, 85%); }
a:visited { color: hsl(264, 77%, 65%); } a:visited { color: hsl(264, 77%, 65%); }
.invert-when-dark { filter: invert(100%); }
} }
/* TODO: Refactor to use the CSS grid */ /* TODO: Refactor to use the CSS grid */