PHPackages                             s1syphos/kirby-highlight - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. s1syphos/kirby-highlight

AbandonedArchivedKirby-plugin[Utility &amp; Helpers](/categories/utility)

s1syphos/kirby-highlight
========================

Themeable server-side syntax highlighting for Kirby

0.6.1(7y ago)1417[1 issues](https://github.com/S1SYPHOS/kirby-highlight/issues)MITCSS

Since Nov 8Pushed 7y ago1 watchersCompare

[ Source](https://github.com/S1SYPHOS/kirby-highlight)[ Packagist](https://packagist.org/packages/s1syphos/kirby-highlight)[ RSS](/packages/s1syphos-kirby-highlight/feed)WikiDiscussions master Synced today

READMEChangelog (7)Dependencies (1)Versions (10)Used By (0)

Kirby Highlight
===============

[](#kirby-highlight)

[![Release](https://camo.githubusercontent.com/5224a03b29f8253313661bc92177decc533d35bfb0d2a929203a0ba3908ff9e2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f5331535950484f532f6b697262792d686967686c696768742e737667)](https://github.com/S1SYPHOS/kirby-highlight/releases) [![License](https://camo.githubusercontent.com/13bd15d1c4ff4210ca9efbb8933b8ba0442f6e38861dd338ed790672f800f94f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f5331535950484f532f6b697262792d686967686c696768742e737667)](https://github.com/S1SYPHOS/kirby-highlight/blob/master/LICENSE) [![Issues](https://camo.githubusercontent.com/ddcbc6a8446b2dab23993c0ea6cb1ece72154dfb48fa01277a60dbd4d58f9b85/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f5331535950484f532f6b697262792d686967686c696768742e737667)](https://github.com/S1SYPHOS/kirby-highlight/issues)

This plugin highlights your code snippets server-side - without external dependencies.

- Code highlighting for everyone - no javascript needed
- Comprehensive: supports [176 languages](https://github.com/S1SYPHOS/kirby-highlight/tree/master/vendor/scrivo/highlight.php/Highlight/languages)
- Customisable: 79 different styles included

[![screenshot of the kirby-highlight plugin](screenshot.gif)](screenshot.gif)

**Table of contents**

- [1. Getting started](#getting-started)
- [2. Configuration](#configuration)
- [3. Styling](#styling)
- [4. Troubleshooting](#troubleshooting)
- [5. Credits / License](#credits--license)

Getting started
---------------

[](#getting-started)

Use one of the following methods to install &amp; use `kirby-highlight`:

### Git submodule

[](#git-submodule)

If you know your way around Git, you can download this plugin as a [submodule](https://github.com/blog/2104-working-with-submodules):

```
git submodule add https://github.com/S1SYPHOS/kirby-highlight.git site/plugins/kirby-highlight

```

### Composer

[](#composer)

```
composer require S1SYPHOS/kirby-highlight:dev-composer

```

### Clone or download

[](#clone-or-download)

1. [Clone](https://github.com/S1SYPHOS/kirby-highlight.git) or [download](https://github.com/S1SYPHOS/kirby-highlight/archive/master.zip) this repository.
2. Unzip / Move the folder to `site/plugins`.

### Activate the plugin

[](#activate-the-plugin)

Activate the plugin with the following line in your `config.php`:

```
c::set('plugin.kirby-highlight', true);

```

Now proper classes are added to your code snippets, making them 'themeable'. In order to do so, head over to the [styling](#styling) section. If you want to activate `kirby-highlight` only on specific domains, read about [multi-environment setups](https://getkirby.com/docs/developer-guide/configuration/options).

Configuration
-------------

[](#configuration)

Change `kirby-highlight` options to suit your needs:

OptionTypeDefaultDescription`plugin.kirby-highlight.class`String`'hljs'`Sets class of surrounding `pre` container.`plugin.kirby-highlight.languages`Array`['html', 'php']`Defines languages to be auto-detected (currently 176 languages are supported).`plugin.kirby-highlight.escaping`Boolean`false`Enables character escaping (converting `` to `&gt;`, ..), see `htmlspecialchars()` [docs](http://php.net/manual/en/function.htmlspecialchars.php).Styling
-------

[](#styling)

All `highlight.js` styles are fully compatible with `kirby-highlight`. Just include it using the `css()` [helper](https://getkirby.com/docs/cheatsheet/helpers/css):

```
