Skip to content

Extensions ​

Extensions add markup features to a renderer. Set them in the extensions option or under app Carve config.

php
$renderer = new \MarkupCarve\CakeCarve\Carve\CarveRenderer();
echo $renderer->toHtml('# Hello', ['extensions' => ['heading_permalinks']]);

Carve input:

carve
# Hello

HTML:

html
<section id="Hello">
  <h1>Hello <a href="#Hello" class="permalink" aria-label="Permalink">ΒΆ</a></h1>
</section>

Pick an extension ​

ExtensionFactory accepts the names below. It also accepts an extension class name, an instance, or an option array with a type key. The table of contents extension is added automatically unless you configure it explicitly.

NameAdds
frontmatterDocument metadata at the top of a file.
heading_permalinksLinks beside headings.
table_of_contentsGenerated heading navigation.
wikilinksWiki style links.
mentionsMention links.
mermaidMermaid fenced blocks.
plantumlPlantUML fenced blocks.
fenced_renderA configurable fenced renderer.
d2D2 diagram blocks.
graphvizGraphviz diagram blocks.
wavedromWaveDrom diagram blocks.
abcABC music blocks.
vega_liteVega Lite visualization blocks.
chartChart blocks.

The factory also accepts installed extension classes by class name or matching snake case name. For a configured wiki link target:

php
'extensions' => [
    ['type' => 'wikilinks', 'url_template' => '/wiki/{page}'],
],

See rendering options for mode and build time renderers.

Released under the MIT License.