Syntax highlighting
Candidus uses Prismjs for color highlighting. Its autoloader plugin makes sure that only the code grammars you need are loaded. Additional scripts and styles are only loaded if this plugin is enabled.
Add syntax highlighting to your page
Syntax highlighting uses Candidus' Plugin System. It will style the code according to the language you specify and your reader's theme preference (light or dark).
html
<script>
window.CANDIDUS = {
SYNTAX_HIGHLIGHTER: {
type: "prism",
}
// ... other plugin options
}
</script>
Example
- Candidus supports all language libraries you can download from the project's homepage.
- The necessary grammar libraries are part of the theme and do not rely on any third-party infrastructure.
- Only language grammars that are part of your article will be loaded