Logarion text system

topics:
enhancements
keywords:
code, highlighting
id:
e8b9a621-4ab6-4e89-b754-203cf80ba08b

Code highlighting

Download: https://highlightjs.org/download/

Don't use Cloudflare, or other content distribution networks, to protect your visitors privacy.

Follow the instructions for selecting the supported languages.

Extract in the highlight directory contained in the .logarion/static directory. Only highlight.pack.js and your preferred stylesheets under styles/ are needed, so optionally, delete any files that shouldn't be served by your host.

Configure

Normally only the notes themselves contain code elements, so this example only enables code highlighting in notes. Edit share/html_templates/note.mustache to enable code highlighting in your article pages. Either at the very top, or very bottom, paste the snippet for including the script and stylesheet and the function call:

<link rel="stylesheet" href="/static/highlight/styles/default.css">
<script src="/static/highlight/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>