PHPackages                             lindemannrock/craft-code-highlighter - 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. lindemannrock/craft-code-highlighter

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

lindemannrock/craft-code-highlighter
====================================

Lightweight syntax highlighting for Craft CMS using Prism.js

5.4.0(2mo ago)00proprietaryCSSPHP ^8.2CI passing

Since Nov 1Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/LindemannRock/craft-code-highlighter)[ Packagist](https://packagist.org/packages/lindemannrock/craft-code-highlighter)[ RSS](/packages/lindemannrock-craft-code-highlighter/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (4)Versions (8)Used By (0)

Code Highlighter for Craft CMS
==============================

[](#code-highlighter-for-craft-cms)

[![Latest Version](https://camo.githubusercontent.com/89d890bb8a3ae3e5f01bc11695f93bc669f00ea6588d43bd6c9c12a80e7ad8b6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c696e64656d616e6e726f636b2f63726166742d636f64652d686967686c6967687465722e737667)](https://packagist.org/packages/lindemannrock/craft-code-highlighter)[![Craft CMS](https://camo.githubusercontent.com/c176c7ad994b4d577c758871323311a223477bd0cd427c40a8472fd0cad04992/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4372616674253230434d532d352e302b2d6f72616e67652e737667)](https://craftcms.com/)[![PHP](https://camo.githubusercontent.com/5fe05c705bf034839bda7651781e4d0a9d42f4a840478ca5e343873a0361bb89/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322b2d626c75652e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/c76088a6ce24bdc56f1bb115344d58726b7fd5e80226a174c97ecf73cb683bcd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c696e64656d616e6e726f636b2f63726166742d636f64652d686967686c6967687465722e737667)](LICENSE)

Professional syntax highlighting for Craft CMS using Prism.js. Perfect for documentation sites, technical blogs, and any site displaying code.

License
-------

[](#license)

This is a commercial plugin licensed under the [Craft License](https://craftcms.github.io/license/). It will be available on the [Craft Plugin Store](https://plugins.craftcms.com) soon. See [LICENSE.md](LICENSE.md) for details.

⚠️ Pre-Release
--------------

[](#️-pre-release)

This plugin is in active development and not yet available on the Craft Plugin Store. Features and APIs may change before the initial public release.

Get Started
-----------

[](#get-started)

### Requirements

[](#requirements)

- Craft CMS 5.0 or greater
- PHP 8.2 or greater

### Installation

[](#installation)

#### Via Composer

[](#via-composer)

1. Navigate to your Craft project directory:

```
cd /path/to/project
```

2. Require the plugin via Composer:

```
composer require lindemannrock/craft-code-highlighter
```

3. Install the plugin:

```
./craft plugin/install code-highlighter
```

#### Using DDEV

[](#using-ddev)

1. Navigate to your Craft project directory:

```
cd /path/to/project
```

2. Require the plugin:

```
ddev composer require lindemannrock/craft-code-highlighter
```

3. Install the plugin:

```
ddev craft plugin/install code-highlighter
```

#### Via Control Panel

[](#via-control-panel)

1. Navigate to **Settings → Plugins** in the Control Panel
2. Search for "Code Highlighter"
3. Click **Install**

### Configuration

[](#configuration)

Create a `code-highlighter.php` file under your `/config` directory with the following options available to you. You can also use multi-environment options to change these per environment.

The below shows the defaults already used by Code Highlighter, so you don't need to add these options unless you want to modify the values.

```
