next generation of the syntaxhighlighter, with prism.js
Go to file
Marcus c3f11e57dd updated prism.small.js size in README and config 2023-06-22 16:14:46 +02:00
res line-numbers config now done and working :) 2023-06-22 16:04:50 +02:00
.gitignore added missing plugin css files, added more languages to prism.small.js, added some more plugins 2023-06-22 14:54:33 +02:00
LICENSE add MIT license 2023-06-21 21:58:43 +02:00 updated prism.small.js size in README and config 2023-06-22 16:14:46 +02:00
config.php updated prism.small.js size in README and config 2023-06-22 16:14:46 +02:00
plugin.syntaxhighlighter.php bump to v1.0.3 2023-06-22 16:09:44 +02:00




based on the original FlatPress plugin syntaxhighlighter from 2005, updated in 2023 to prism.js


Download the latest release and extract to your fp-plugins/ folder.

If you want to use git, use

$ git clone /pathto/flatpress/fp-plugins/syntaxhighlighter/

codeblock with language syntax highlightning

When you just create an [code][/code] block, then there will be no syntax highlightning.

To enable it, you have to specify the language you want to get highlighted, for example:

if [ "$1" == "bash" ] 
  echo "Yeah :)"
  echo "something else"

For all language tags see Not all listed languages are available by default, please see the configuration below!


You can configure the used size of prismjs and it's theme. For that just edit config.php and set your favorite.

The default values are small for size (see available languages below) and okaidia for the theme.

 * size: tiny, small, full
 *        tiny: 21KB (Markup, HTML, XML, SVG, MathML, SSML, Atom, RSS, CSS, C-like, JavaScript)
 *        small: 106KB (markup, css, clike, javascript, apacheconf, arduino, bash, basic, batch, 
 *                    bbcode, c, cpp, cmake, csv, diff, docker, git, go, http, ini, java, json,
 *                    log, makefile, markdown, markup-templating, nginx, pascal, perl, php,
 *                    powershell, python, ruby, shell-session, sql, typescript, vbnet,
 *                    visual-basic, wiki, yaml)
 *        full: 567KB (see for list of supported languages)
 * theme: coy, dark, default, funky, okaidia, solarizedlight, tomorrow, twilight
 * line-numbers: 'true' or 'false' (Do show line numbers or not)

return [
        // change here
        'size' => 'small',
        'theme' => 'okaidia',
        'line-numbers' => 'true',