added missing plugin css files, added more languages to prism.small.js, added some more plugins

This commit is contained in:
Marcus 2023-06-22 14:54:33 +02:00
parent 4d23ed4753
commit 0a3f88ada4
5 changed files with 54 additions and 29 deletions

4
.gitignore vendored Normal file
View file

@ -0,0 +1,4 @@
makerelease.sh
mirror.sh
syntaxhighlighter/
syntaxhighlighter-*.zip

View file

@ -48,20 +48,24 @@ The default values are `small` for size (see available languages below) and `oka
* tiny: 21KB (Markup, HTML, XML, SVG, MathML, SSML, Atom, RSS, CSS, C-like, JavaScript) * tiny: 21KB (Markup, HTML, XML, SVG, MathML, SSML, Atom, RSS, CSS, C-like, JavaScript)
* *
* small: 95KB (Markup, HTML, XML,SVG, MathML, SSML, Atom, RSS, CSS, C-Linke, JavaScript * small: 95KB (Markup, HTML, XML,SVG, MathML, SSML, Atom, RSS, CSS, C-Linke, JavaScript
* Apache, Bash, Batch, BBCode, C, C#, C++, CSV, Diff, Go, HTTP, ini, Java * Apache, Arduino, Bash Shell, Batch, BBCode, C, C#, C++, CMake, CSV, Diff,
* JSON, Makefile, Markdown, nginx, Perl, PHP, PowerShell, Python, Ruby * Docker, Git, Go, HTTP, ini, Java, JSON, Log file, Makefile, Markdown,nginx,
* Shell session, SQL, VB.Net, Wiki markup, YML) * Pascal, Perl, PHP, PowerShell, Python, Ruby, Shell session, SQL, Typescript,
* VB.Net, Visual Basic, Wiki markup, YML)
* *
* full: 567KB (see https://prismjs.com/index.html#supported-languages for list of supported languages) * full: 567KB (see https://prismjs.com/index.html#supported-languages for list of supported languages)
* *
* theme: coy, dark, default, funky, okaidia, solarizedlight, tomorrow, twilight * theme: coy, dark, default, funky, okaidia, solarizedlight, tomorrow, twilight
* *
* plugins: line-numbers, unescaped-markup, diff-highlight, toolbar, copy-to-clipboard (depends on toolbar)
*
*/ */
return [ return [
// change here // change here
'size' => 'small', 'size' => 'small',
'theme' => 'okaidia', 'theme' => 'okaidia',
'plugins' => ['unescaped-markup', 'line-numbers', 'diff-highlight'],
] ]
?> ?>
``` ```

View file

@ -51,6 +51,7 @@ function plugin_syntaxhighlighter_head() {
echo <<<PRISMJS echo <<<PRISMJS
<!-- start of prism.js header --> <!-- start of prism.js header -->
<link rel="stylesheet" type="text/css" href="{$pdir}res/prism.plugins.css" />
<link rel="stylesheet" type="text/css" href="{$pdir}res/prism-{$config['theme']}.css" /> <link rel="stylesheet" type="text/css" href="{$pdir}res/prism-{$config['theme']}.css" />
<!-- end of prism.js header --> <!-- end of prism.js header -->
@ -70,7 +71,7 @@ function plugin_syntaxhighlighter_foot() {
$pdir=plugin_geturl('syntaxhighlighter'); $pdir=plugin_geturl('syntaxhighlighter');
// javascript part // javascript part
echo <<<PRISMBOX echo <<<PRISMBOX
<!-- start of prism.js footer --> <!-- start of prism.js footer -->
<script type="text/javascript" src="{$pdir}res/prism.{$config['size']}.js"></script> <script type="text/javascript" src="{$pdir}res/prism.{$config['size']}.js"></script>

8
res/prism.plugins.css Normal file
View file

@ -0,0 +1,8 @@
/* unescaped-markup */
[class*=lang-] script[type='text/plain'],[class*=language-] script[type='text/plain'],script[type='text/plain'][class*=lang-],script[type='text/plain'][class*=language-]{display:block;font:100% Consolas,Monaco,monospace;white-space:pre;overflow:auto}
/* line-numbers */
pre[class*=language-].line-numbers{position:relative;padding-left:3.8em;counter-reset:linenumber}pre[class*=language-].line-numbers>code{position:relative;white-space:inherit}.line-numbers .line-numbers-rows{position:absolute;pointer-events:none;top:0;font-size:100%;left:-3.8em;width:3em;letter-spacing:-1px;border-right:1px solid #999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.line-numbers-rows>span{display:block;counter-increment:linenumber}.line-numbers-rows>span:before{content:counter(linenumber);color:#999;display:block;padding-right:.8em;text-align:right}
/* diff-highlight */
pre.diff-highlight>code .token.deleted:not(.prefix),pre>code.diff-highlight .token.deleted:not(.prefix){background-color:rgba(255,0,0,.1);color:inherit;display:block}pre.diff-highlight>code .token.inserted:not(.prefix),pre>code.diff-highlight .token.inserted:not(.prefix){background-color:rgba(0,255,128,.1);color:inherit;display:block}
/* toolbar */
div.code-toolbar{position:relative}div.code-toolbar>.toolbar{position:absolute;z-index:10;top:.3em;right:.2em;transition:opacity .3s ease-in-out;opacity:0}div.code-toolbar:hover>.toolbar{opacity:1}div.code-toolbar:focus-within>.toolbar{opacity:1}div.code-toolbar>.toolbar>.toolbar-item{display:inline-block}div.code-toolbar>.toolbar>.toolbar-item>a{cursor:pointer}div.code-toolbar>.toolbar>.toolbar-item>button{background:0 0;border:0;color:inherit;font:inherit;line-height:normal;overflow:visible;padding:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}div.code-toolbar>.toolbar>.toolbar-item>a,div.code-toolbar>.toolbar>.toolbar-item>button,div.code-toolbar>.toolbar>.toolbar-item>span{color:#bbb;font-size:.8em;padding:0 .5em;background:#f5f2f0;background:rgba(224,224,224,.2);box-shadow:0 2px 0 0 rgba(0,0,0,.2);border-radius:.5em}div.code-toolbar>.toolbar>.toolbar-item>a:focus,div.code-toolbar>.toolbar>.toolbar-item>a:hover,div.code-toolbar>.toolbar>.toolbar-item>button:focus,div.code-toolbar>.toolbar>.toolbar-item>button:hover,div.code-toolbar>.toolbar>.toolbar-item>span:focus,div.code-toolbar>.toolbar>.toolbar-item>span:hover{color:inherit;text-decoration:none}

File diff suppressed because one or more lines are too long