Development version, not released
Skip to content

Extensions ​

The 0.2 extension host is provisional. A converter profile's extensions list takes Carve ExtensionDefinition or ExtensionProvider objects, or the names below. A name is a string ('details') or an array with a type key and options (['type' => 'table_of_contents', 'max_level' => 3]). Unknown names and options fail with an InvalidArgumentException.

Each name is also a case of carve-php's MarkupCarve\Carve\Extension\Name enum, which works wherever the string does:

php
use MarkupCarve\Carve\Extension\Name;

'extensions' => [
    'details',
    Name::CodeCallouts,
    ['type' => Name::ExternalLinks, 'internal_hosts' => ['example.com']],
],

Names ​

Options are the parameters of the carve-php factory each name calls, written in snake case: css_class sets $cssClass. Closure parameters cannot be set from configuration; pass the engine object instead.

Namecarve-php factoryOptions
abc, chart, d2, graphviz, mermaid, vega_lite, wavedromFencedRender::<preset>()css_class, tag, wrap_in_figure, figure_class, label
fenced_renderFencedRender::bundle()language (required), css_class, tag, content_mode, wrap_in_figure, figure_class, label
plantumlcarve-php fenced renderer for plantuml and pumlcss_class
autolinkNavigation::autolink()allowed_schemes
external_linksNavigation::externalLinks()target, rel, nofollow, internal_hosts
heading_numbersNavigation::headingNumbers()min_level, label, crossref
heading_permalinksNavigation::headingPermalinks()symbol, css_class, aria_label, levels, prepend, show_on_hover, copy_to_clipboard
heading_referenceNavigation::headingReference()css_class
link_policyNavigation::linkPolicy()allowed_schemes, denied_schemes, allowed_domains, denied_domains, allow_external, allow_internal, rel, base_host
table_of_contentsNavigation::tableOfContents()min_level, max_level, list_type, css_class, position, collapsible, summary, open
toc_placementNavigation::tocPlacement()none
citationsCitations::bundle()mode, bibliography
code_callouts, details, glossary, list_table, semantic_span, spoiler<Extension>::bundle()none
code_groupCodeGroup::bundle()mode, wrapper_class, panel_class, label_class, radio_class, id_prefix, group_label
color_swatchColorSwatch::bundle()position, shape, tint, reveal
default_attributesTransforms::defaultAttributes()defaults (required)
img_fenceImgFence::definition() with its rendererlanguage (default img and image)
index, index_termsIndexTerms::bundle()backref_label
inline_footnotesTransforms::inlineFootnotesToParentheses()none
math_blockMathBlock::bundle()language
smart_quotesSmartQuotes::bundle()locale, open_double_quote, close_double_quote, open_single_quote, close_single_quote
tab_normalizeTransforms::tabNormalize()width (0 to 16, default 2)
tabsthe standard Carve tabs definitionsmode (css or aria)
wikilinksWikilinks::bundle()url_template ({page} is the slug), css_class, new_window

ExtensionFactory::types() returns every name, the same list as Name::values().

Mentions and tags are core 0.2 options, not extensions: set the profile's social setting. See the migration guide and the Carve extension guide.

Released under the MIT License.