The core of the Marp converter.
Marp Core extends the Marpit framework with practical Markdown syntax, advanced features, official themes, and optional core plugins.
Important
⚡️ Release Candidate: Marp Core v5 is currently a release candidate, and this README documents v5. Current Marp tools may still use stable v4; see the v4 branch for v4 documentation.
Marp Core v5 supports Node.js 20.19 or later, but we highly recommend using an actively supported Node.js version.
npm install --save @marp-team/marp-core@nextSince v5, Marp Core has been split into a lightweight core and optional core plugins.
| Entrypoint | Description | Bundled size* |
|---|---|---|
@marp-team/marp-core |
Lightweight core with Marp's essential features | 0.5MiB |
@marp-team/marp-core/full |
Full build with all core plugins (requires installing all optional dependencies) |
11.4MiB |
*: Rough estimates for a minified browser ESM build before gzip. The full entrypoint includes all optional dependencies.
The full build provides a consistent experience across the Marp toolchain. For your own application, we recommend the lightweight core with only the plugins you need.
About the @marp-team/marp-core/browser entrypoint, see the browser helper.
Marp Core also provides optional plugins for several core features. These often require additional dependencies along with Marp Core.
| Plugin | Feature | Optional dependency |
|---|---|---|
@marp-team/marp-core/plugins/shiki |
Syntax highlighting powered by Shiki | shiki |
@marp-team/marp-core/plugins/mermaid |
Mermaid rendering powered by beautiful-mermaid | beautiful-mermaid |
@marp-team/marp-core/plugins/katex |
Math typesetting powered by KaTeX | katex |
@marp-team/marp-core/plugins/mathjax |
Math typesetting powered by MathJax | @mathjax/src@mathjax/mathjax-bbm-font-extension@mathjax/mathjax-bboldx-font-extension@mathjax/mathjax-dsfont-font-extension@mathjax/mathjax-mhchem-font-extension |
To use @marp-team/marp-core/full, install every optional dependency along with Marp Core:
npm install --save \
@marp-team/marp-core@next \
shiki \
beautiful-mermaid \
katex \
@mathjax/src \
@mathjax/mathjax-bbm-font-extension \
@mathjax/mathjax-bboldx-font-extension \
@mathjax/mathjax-dsfont-font-extension \
@mathjax/mathjax-mhchem-font-extensionMarp Core provides the Marp class, inherited from Marpit, so its basic usage is the same as Marpit.
import { Marp } from '@marp-team/marp-core'
const marp = new Marp()
const { html, css } = marp.render('# Hello, marp-core!')Use @marp-team/marp-core/full instead when you want the full build.
See the Marpit usage documentation for more details.
Add optional core plugins selectively by chaining use().
import { Marp } from '@marp-team/marp-core'
import katexPlugin from '@marp-team/marp-core/plugins/katex'
import shikiPlugin from '@marp-team/marp-core/plugins/shiki'
const marp = new Marp().use(shikiPlugin()).use(katexPlugin())You can also add any Marpit-compatible plugin.
Choose the guide that matches what you want to do:
- Markdown features - Write slides with Marp Markdown
- Built-in themes - All about the official themes
- Theme authoring - Create a custom theme suitable for Marp
- Configuration - Integrate Marp Core into your project
- Migration from v4 to v5 - Changes in v5 and how to migrate
Interested in contributing? See CONTRIBUTING.md and the common contribution guidelines for the Marp team.
Managed by @marp-team.
Yuki Hattori (@yhatt)
This package is released under the MIT License.