lolight for Flarum (Syntax Alternative)
A Flarum extension which provides an alternative to the built-in syntax/code highlighting style. This allows you to use [syntax][/syntax]
which will then use the lolight JavaScript from Lars Jung to make your code beautiful in a minimal way. The JavaScript used to do this is less than 3kb. Visit https://larsjung.de/lolight/ for more information.
warning
I believe (at least at my forum) this will prevent the built in markdown syntax highlighter from working. But, the [code]
BBCode will still work. So you still have a choice of using the default [code]
BBCode (as long as you have that core extension activated) or this new [syntax]
BBCode.
but, why?
I personally wanted a slightly different looking syntax highlighter. Still minimal like the default, but different... That's all. Not really anything amazing. 🙂
If you want to tweak the style, here's the CSS code you may use (add to Flarum's custom CSS in the admin):
.ll-nam { /* words */
color: #2196f3;
}
.ll-num { /* numbers */
color: #ec407a;
}
.ll-str { /* strings */
color: #43a047;
}
.ll-rex { /* regular expressions */
color: #ef6c00;
}
.ll-pct { /* operators, punctation */
color: #666;
}
.ll-key { /* keywords */
color: #555;
font-weight: bold;
}
.ll-com { /* comments */
color: #aaa;
font-style: italic;
}
Install
composer require zerosonesfun/lolight
Update
composer update zerosonesfun/lolight
Remove
composer remove zerosonesfun/lolight
And, if removing permanently, remove the leftover folder that was added to your public assets folder.
Links