@mirrordown/mdit-definition-list
v0.1.3
Published
A markdown-it plugin for definition lists (term / : definition), rendering <dl>, <dt>, and <dd> elements.
Downloads
830
Readme
@mirrordown/mdit-definition-list
Part of Mirrordown — a suite of markdown syntax extensions for the unified and markdown-it ecosystems.
A markdown-it plugin for the definition-list syntax extension.
Overview
The definition-list plugin renders Pandoc-style definition lists as HTML <dl>, <dt>, and <dd> elements.
<dl>
<dt>Term</dt>
<dd>Definition</dd>
</dl>Syntax
Write a term on one line, then follow it with one or more definitions prefixed by : or ~ :
Apple
: A round fruit with red or green skin.
: Also a technology company.
Orange
: A citrus fruit with orange skin.
Multiple terms can share definitions:
HTTP
HTTPS
: Protocols for transferring data on the web.Install
npm install @mirrordown/mdit-definition-listStandalone
import MarkdownIt from "markdown-it";
import { definitionList } from "@mirrordown/mdit-definition-list";
const md = new MarkdownIt().use(definitionList);VitePress
// .vitepress/config.ts
import { defineConfig } from "vitepress";
import { definitionList } from "@mirrordown/mdit-definition-list";
export default defineConfig({
markdown: {
config: (md) => md.use(definitionList)
}
});Documentation
Full documentation, more examples, and configuration options: github.com/mirrordown/mirrordown (dedicated docs site coming soon).
License
MIT © Drake Costa
