@mirrordown/remd-sup
v0.1.3
Published
A remark plugin for superscript syntax (^text^), rendering <sup> elements.
Readme
@mirrordown/remd-sup
Part of Mirrordown — a suite of markdown syntax extensions for the unified and markdown-it ecosystems.
A remark/rehype (unified) plugin for the sup syntax extension.
Overview
The sup plugin renders ^text^ as an HTML <sup> element, representing superscript text.
<sup>text</sup>Syntax
Wrap text in single carets to render it as superscript:
E = mc^2^
The Pythagorean theorem: a^2^ + b^2^ = c^2^Install
npm install @mirrordown/remd-supUnified
import { unified } from "unified";
import remarkParse from "remark-parse";
import remarkRehype from "remark-rehype";
import rehypeStringify from "rehype-stringify";
import { remarkSup } from "@mirrordown/remd-sup";
const processor = unified()
.use(remarkParse)
.use(remarkSup)
.use(remarkRehype)
.use(rehypeStringify);Astro
// astro.config.ts
import { defineConfig } from "astro/config";
import { remarkSup } from "@mirrordown/remd-sup";
export default defineConfig({
markdown: {
remarkPlugins: [remarkSup]
}
});VitePress
// .vitepress/config.ts
import { defineConfig } from "vitepress";
import { remarkSup } from "@mirrordown/remd-sup";
export default defineConfig({
markdown: {
remarkPlugins: [remarkSup]
}
});Documentation
Full documentation, more examples, and configuration options: github.com/mirrordown/mirrordown (dedicated docs site coming soon).
License
MIT © Drake Costa
