2017 © Pedro Peláez
 

kirby-plugin kirby-highlight

Themeable server-side syntax highlighting for Kirby

image

s1syphos/kirby-highlight

Themeable server-side syntax highlighting for Kirby

  • Saturday, March 31, 2018
  • by S1SYPHOS
  • Repository
  • 2 Watchers
  • 11 Stars
  • 0 Installations
  • CSS
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

Kirby Highlight

Release License Issues, (*1)

This plugin highlights your code snippets server-side - without external dependencies., (*2)

  • Code highlighting for everyone - no javascript needed
  • Comprehensive: supports 176 languages
  • Customisable: 79 different styles included

screenshot of the kirby-highlight plugin, (*3)

Table of contents - 1. Getting started - 2. Configuration - 3. Styling - 4. Troubleshooting - 5. Credits / License, (*4)

Getting started

Use one of the following methods to install & use kirby-highlight:, (*5)

Git submodule

If you know your way around Git, you can download this plugin as a submodule:, (*6)

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

Composer

composer require S1SYPHOS/kirby-highlight:dev-composer

Clone or download

  1. Clone or download this repository.
  2. Unzip / Move the folder to site/plugins.

Activate the plugin

Activate the plugin with the following line in your config.php:, (*7)

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 section. If you want to activate kirby-highlight only on specific domains, read about multi-environment setups., (*8)

Configuration

Change kirby-highlight options to suit your needs:, (*9)

Option Type Default Description
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 &lt;, > to &gt;, ..), see htmlspecialchars() docs.

Styling

All highlight.js styles are fully compatible with kirby-highlight. Just include it using the css() helper:, (*10)

<?php echo css('assets/plugins/kirby-highlight/css/zenburn.css') ?>

Troubleshooting

If in doubt, check the correct spelling of the language in question - doing otherwise breaks kirbytext() (see #2)., (*11)

Credits / License

kirby-highlight is based on Geert Bergman's highlight.php library (a PHP port of highlight.js). It is licensed under the MIT License, but using Kirby in production requires you to buy a license. Are you ready for the next step?, (*12)

Special Thanks

I'd like to thank everybody that's making great software - you people are awesome. Also I'm always thankful for feedback and bug reports :), (*13)

The Versions

31/03 2018

dev-composer

dev-composer

Themeable server-side syntax highlighting for Kirby

  Sources   Download

MIT

The Requires

 

31/03 2018

dev-master

9999999-dev

Themeable server-side syntax highlighting for Kirby

  Sources   Download

MIT

The Requires

 

03/03 2018

0.5.1

0.5.1.0

Themeable server-side syntax highlighting for Kirby

  Sources   Download

MIT

The Requires

 

09/01 2018

0.5.0

0.5.0.0

  Sources   Download

The Requires

 

11/11 2017

0.4.0

0.4.0.0

  Sources   Download

The Requires

 

09/11 2017

0.3.0-beta

0.3.0.0-beta

  Sources   Download

The Requires

 

09/11 2017

0.2.0-beta

0.2.0.0-beta

  Sources   Download

The Requires

 

08/11 2017

0.1.0-beta

0.1.0.0-beta

  Sources   Download

The Requires