Arcane Lexicon registers a default extension pipeline for every page.
Default Extension Order#
KnowledgeBaseApp.create() currently applies extensions in this order:
MediaExtensionCalloutExtensionHeadingAnchorsExtensionTableOfContentsExtensionReadingTimeExtension
Custom extensions passed in extensions: are appended after these defaults.
MediaExtension#
Transforms custom media syntax:
@[youtube](dQw4w9WgXcQ)
@[video autoplay loop muted](demo.mp4)
@[image caption="Screenshot"](image.png)
@[gif](loader.gif)
@[apng](animation.png)
@[twitter](1215212801876090880)
@[iframe title="Embed" height="500"](https://example.com/embed)
Supported media types:
youtubevideoimage/imggifapngtwitter/xiframe
CalloutExtension#
Transforms GitHub-style callouts into GitHub alert markup and preserves rich callout tags as Arcane component callouts.
> [!NOTE]
> Informational message.
> [!WARNING] Java 21 Required
> Use Java 21 or newer.
Supported types:
NOTETIPIMPORTANTWARNINGCAUTION
Optional title is supported on the marker line.
HeadingAnchorsExtension#
Adds heading anchors so sections are deep-linkable.
TableOfContentsExtension#
Generates TOC data consumed by the right-side TOC panel when SiteConfig.tocEnabled is true.
ReadingTimeExtension#
Adds:
readingTimewordCount
Default reading speed is 200 WPM.
KnowledgeBaseApp.create(
config: config,
stylesheet: stylesheet,
extensions: const <PageExtension>[
ReadingTimeExtension(wordsPerMinute: 250),
],
)
Default Custom Components#
In addition to extensions, Arcane Lexicon registers default custom markdown components.
See Components for complete syntax and live examples.
Registered by default:
CardGroup,CardColumns,ColumnTiles,TileSteps,StepAccordionGroup,Accordion,ExpandableBadge,Banner,Panel,Frame,UpdateTooltip,Icon,CodeGroupFieldGroup,ParamField,ResponseFieldTree,Tree.Folder,Tree.FileColor,Color.ItemView-
Callout tags:
Note,Tip,Warning,Info,Check,Caution,Important TabsandTabItem
Adding Custom Extensions#
class MyExtension implements PageExtension {
const MyExtension();
@override
Future<List<Node>> apply(Page page, List<Node> nodes) async {
String content = page.content;
String updated = content.replaceAll('foo', 'bar');
if (updated != content) {
page.apply(content: updated);
}
return nodes;
}
}
KnowledgeBaseApp.create(
config: config,
stylesheet: stylesheet,
extensions: const <PageExtension>[
MyExtension(),
],
)
Syntax Highlighting Notes#
Arcane Lexicon includes Highlight.js setup in KBLayout scripts.
Common classes are normalized for:
dartjavascript/jsyamlbash/shelljsonhtmlcss