3 * Name: Syntax Highlighting
4 * Description: Highlights syntax of code blocks with highlight.js
6 * Author: Hypolite Petovan <hypolite@mrpetovan.com>
10 use Friendica\Core\Addon;
12 function highlightjs_install()
14 Addon::registerHook('head' , __FILE__, 'highlightjs_head');
15 Addon::registerHook('footer', __FILE__, 'highlightjs_footer');
18 function highlightjs_uninstall()
20 Addon::unregisterHook('head' , __FILE__, 'highlightjs_head');
21 Addon::unregisterHook('footer', __FILE__, 'highlightjs_footer');
24 function highlightjs_head(App $a, &$b)
26 if ($a->getCurrentTheme() == 'frio') {
32 $a->registerStylesheet(__DIR__ . '/asset/styles/' . $style . '.css');
35 function highlightjs_footer(App $a, &$b)
37 $a->registerFooterScript(__DIR__ . '/asset/highlight.pack.js');
38 $a->registerFooterScript(__DIR__ . '/highlightjs.js');