Skip to content
This repository was archived by the owner on Feb 26, 2021. It is now read-only.

iksi/kirby-commonmark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kirby CommonMark

Replaces Kirby’s markdown component for one that uses CommonMark. It uses league/commonmark, a Markdown parser for PHP which supports the full CommonMark spec.

Installation

As a git submodule: git submodule add git@github.com:iksi/kirby-commonmark.git site/plugins/kirby-commonmark. Or you can put the contents of the repository in site/plugins/kirby-commonmark.

Next the league/commonmark dependency needs to be installed with composer: composer require league/commonmark:^0.16. Require the generated vendor/autoload.php file from a custom site.php:

<?php

require_once __DIR__ . DS . 'vendor' . DS . 'autoload.php';

$kirby = kirby();

Configuration

c::set('plugin.commonmark', true);
c::set('plugin.commonmark.config', []);

Options for plugin.commonmark.config are listed on http://commonmark.thephpleague.com/configuration/.

Custom extensions

You can add your own extensions (bundled custom parsers/renderers), see customization:

c::set('plugin.commonmark.extensions', []);

License

MIT

About

Replaces Kirby’s markdown component for one that uses CommonMark

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages