Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@marp-team/marpit

marp-team22.6kMIT3.1.3TypeScript support: included

The skinny framework for creating slide deck from Markdown

marp, markdown, parser, slide, deck, presentation

readme

Marpit Marpit

Marpit: Markdown slide deck framework

CircleCI Codecov npm LICENSE


Marpit /mɑːrpɪt/ is the skinny framework for creating slide deck from Markdown. It can transform Markdown and CSS theme(s) to slide deck composed of static HTML and CSS and create a web page convertible into slide PDF by printing.

Marpit is designed to output minimum assets for the slide deck. You can use the bare assets as a logicless slide deck, but mainly we expect to integrate output with other tools and applications.

In fact, this framework is created for using as the base of a core converter in Marp ecosystem.

Features

:pencil: Marpit Markdown

We have extended several features into markdown-it parser to support writing awesome slides, such as Directives and Slide backgrounds. Additional syntaxes place importance on a compatibility with general Markdown documents.

:art: Theme CSS by clean markup

Marpit has the CSS theming system that can design slides everything. Unlike other slide frameworks, there are not any predefined classes and mixins. You have only to focus styling HTML elements by pure CSS. Marpit would take care of the selected theme's necessary conversion.

:triangular_ruler: Inline SVG slide (Experimental)

Optionally <svg> element can use as the container of each slide page. It can be realized the pixel-perfect scaling of the slide only by CSS, so handling slides in integrated apps become simplified. The isolated layer made by <foreignObject> can provide advanced backgrounds for the slide with keeping the original Markdown DOM structure.

We not provide any themes because Marpit is just a framework. You can use @marp-team/marp-core if you want. It has the official themes, and practical features extended from Marpit.

Getting started

See the documentation of Marpit to get started.

Contributing

Are you interested in contributing? See CONTRIBUTING.md and the common contributing guideline for Marp team.

Development

git clone https://github.com/marp-team/marpit
cd marpit

npm install
npm run build

Sub-projects

Author

Managed by @marp-team.

License

This framework releases under the MIT License.

changelog

Change Log

[Unreleased]

v3.1.3 - 2025-05-13

Added

  • Test against Node.js 24 (#413)
  • Added print-color-adjust property to print CSS (#410, #412)

Changed

  • Upgrade Node.js LTS and dependent packages to the latest version (#413)

Fixed

  • Scaffold theme: Don't overload UA's inline margin for <h1> element (#414)

v3.1.2 - 2024-12-23

Changed

  • Upgrade Node.js LTS and dependent packages to the latest version (#405)

v3.1.1 - 2024-08-31

Fixed

  • Update type definition to add cssNesting constructor option (#401)

v3.1.0 - 2024-08-30

Added

  • Support for CSS nesting (cssNesting constructor option) (#397, #399)
  • Allow CSS Q unit as slide size definitions (#400)

Changed

  • Upgrade development Node.js and dependent packages to the latest (#398)

v3.0.0 - 2024-05-17

Breaking

  • Drop support against end-of-lifed Node.js versions (v16 and earlier) (#291, #380)

Added

  • Add -webkit-text-size-adjust: 100%; to the scaffold theme (#389)

Changed

  • Bump markdown-it to v14.1.0, and follow the latest spec of CommonMark 0.31.2 (#393)
  • Switch package manager from yarn to npm (#391)
  • Upgrade development Node.js to v20 LTS (#392)
  • Upgrade dependent packages to the latest version (#393)
  • Migrate ESLint config to Flat config (#394)

Removed

  • Deprecated color setting shorthand via Markdown image syntax (#331, #379)

v2.6.1 - 2023-10-15

Fixed

  • Add TypeScript definition for cssContainerQuery constructor option (#378)

v2.6.0 - 2023-10-15

Added

  • cssContainerQuery constructor option (#355, #377)
  • lang global directive and constructor option (#376)

Changed

  • Upgrade dependent packages to the latest version (#375)

v2.5.3 - 2023-09-11

Fixed

  • Advanced background: Exclude Marpit reserved image keywords from <figcaption> correctly (#373)

v2.5.2 - 2023-09-11

Fixed

  • Fix blocking paginate: skip and hold in v2.5.1 inline SVG mode (#372)

v2.5.1 - 2023-09-09

Added

  • Advanced background: Render the image's alt text to <figcaption> (#368, #371)

Fixed

  • Begin the page number from 1 even if used paginate: hold at the first page (#365, #370)

Changed

  • Upgrade Node.js and dependent packages to the latest version (#369)

v2.5.0 - 2023-06-06

Added

Changed

  • Upgrade Node.js LTS and dependent packages to the latest version (#360)
  • New looks for Marpit API documentation (#360)

v2.4.2 - 2022-11-13

Added

  • Test against Node.js 18 LTS (#344, #345)

Changed

  • Upgrade dependent packages to the latest version (#345)

v2.4.1 - 2022-09-10

Fixed

  • Improve module interface of @marp-team/marpit/plugin to make compatible with CJS (#341)

Changed

  • Upgrade dependent packages to the latest version (#342)

Removed

  • Continuous test against EoL Node.js 12 (#291, #342)

v2.4.0 - 2022-08-11

Added

  • anchor constructor option for slide anchor customization (#335, #340)

Changed

  • Upgrade dependent packages to the latest version (#339)

v2.3.1 - 2022-05-21

Fixed

  • Fix invalid scoping for updated :root selector (#336, #337)

v2.3.0 - 2022-05-21

Changed

  • Upgrade dependent packages to the latest version (#332)

Fixed

  • Match :root selector specificity to original exactly (#330, #333)

Deprecated

  • Emit deprecation warning when used color setting shorthand via Markdown image syntax (#331, #334)

Removed

  • Continuous test against EoL Node.js 10 (#291, #332)

v2.2.4 - 2022-04-12

Fixed

  • Scoped style does not style pseudo elements section::before and section::after in advanced background (#328, #329)

v2.2.3 - 2022-03-27

Changed

  • Upgrade dependent packages to the latest version (#327)

v2.2.2 - 2022-01-23

Changed

  • Upgrade dependent packages to the latest version (#325)

v2.2.1 - 2022-01-07

Changed

  • Upgrade dependent packages to the latest version (#322)

v2.2.0 - 2021-11-19

Added

Fixed

  • Remove recognized image keywords from alt text (#316, #318)

Changed

  • Upgrade dependent packages to the latest version (#320)

v2.1.2 - 2021-10-26

Changed

  • Upgrade development Node to v16 LTS (#314)
  • Upgrade dependent packages to the latest version (#315)

v2.1.1 - 2021-08-14

Changed

  • Upgrade dependent packages to the latest version (#308)

v2.1.0 - 2021-07-08

Added

  • CI test against Node 16 (#306)

Changed

  • Change how to increase specificity of section defined by :root selector (#302)
  • Upgrade dependent packages to the latest version (#301, #306)
  • Follow the latest CommonMark spec 0.30 (#306)

v2.0.1 - 2021-04-27

Fixed

  • Fix regression: Append inline styles into the end of CSS correctly (#288, #289)

v2.0.0 - 2021-03-26

Breaking

  • Marpit requires Node.js >= 10 to install (#284)

Fixed

  • Reset CSS columns in advanced background (#283)

Changed

  • Upgrade to PostCSS 8 (#260, #284)
  • Upgrade Node and dependent packages to the latest version (#285)

Removed

  • Remove deprecated markdownItPlugins, the getter of plugin interface for markdown-it (#286)

v1.6.4 - 2021-02-06

Fixed

  • Split slides only in first level rulers (#273, #277)
  • Fix loose YAML parsing for quoted spot directive (#278)

Changed

  • Upgrade dependent packages to the latest version (#276)
  • Rename master branch to main (#279)

v1.6.3 - 2020-12-05

Added

  • Node 14 support (#267)

Fixed

  • Escape the built selector for scoping CSS (#256)

Changed

  • Upgrade Node and dependent packages to the latest version (#255, #266)

v1.6.2 - 2020-06-08

Changed

  • Upgrade dependent packages to the latest version (#249)

v1.6.1 - 2020-05-17

Fixed

  • Slide size defined in :root selector does not reflect to the theme instance (#244, #246)
  • :root selector in Marpit is not following the specification of specificity (#245, #247)

v1.6.0 - 2020-05-09

Added

  • Make scoped keyframe names if defined @keyframes in <style scoped> (#231, #237)
  • Correct support of :root pseudo-class selector and rem unit for theme CSS (#232, #240)

Fixed

  • Disable CSS transitions and animations in the style for print (#238, #239)

Changed

  • Upgrade dependent packages to the latest version (#241)
  • Use ESLint recommended config instead of eslint-config-airbnb (#242)

v1.5.3 - 2020-05-04

Fixed

  • Don't prepend scoping selector into keyframes in <style scoped> (#236)

Changed

  • Upgrade dependent packages to the latest version (#234)
  • Bump Node LTS version (#234)

Removed

  • Get rid of browser-sync for previewing docs (#235)

v1.5.2 - 2020-04-18

Changed

  • Upgrade dependent packages to the latest version (#225, #226, #229)

v1.5.1 - 2020-03-15

Changed

  • On the basis of the YAML specification, 3 dots ... can use as an alternative to indicate the end of YAML front-matter (#224)
  • Upgrade Node and dependent packages to the latest version (#224)

v1.5.0 - 2020-01-12

Added

  • @marp-team/marpit/plugin for creating Marpit plugin (#214, #217)

Changed

Removed

  • CI test against EOL Node 8 (#216)
  • Marpit prefixes in the name of some type definitions for TypeScript (#217)

v1.4.2 - 2019-11-06

Fixed

  • Apply workaround for glitched video control on Chromium (#205, #208)

Changed

  • Upgrade Node for development to v12 LTS (#202)
  • Upgrade dependent packages to the latest version (#207)

v1.4.1 - 2019-10-18

Changed

  • Ignore well-known magic comments in collected comments (#191, #199)
  • Upgrade dependent packages to the latest version (#196, #201)

v1.4.0 - 2019-09-12

Changed

  • Update CircleCI configuration to use v2.1 (#187)
  • Bump markdown-it to v10.0.0 (#190)
  • Upgrade Node and dependent packages to the latest version (#190)

Removed

  • Deprecated dollar prefix alias for global directive (#182, #189)

v1.3.2 - 2019-08-23

Fixed

  • Override declaration of <section> for advanced background to display: block (#185)

Changed

  • Upgrade dependent packages to the latest version (#186)

v1.3.1 - 2019-08-11

Added

Changed

  • Allow aliasing from custom directive to built-in directives (#183)
  • Upgrade dependent packages to the latest version (#184)

Deprecated

  • Dollar prefix for global directive (#182, #183)

v1.3.0 - 2019-07-11

Added

  • Loose YAML parsing for custom directives (#173)

Changed

  • Follow the latest spec of CommonMark 0.29 by upgraded markdown-it v9 (#174)
  • Allow customization the content of pagination (#175)
  • Upgrade dependent packages to the latest version (#176)

Removed

  • Remove deprecated dot notation support for meta in ThemeSet#getThemeProp (#177)

v1.2.0 - 2019-06-17

Added

Fixed

  • Finalize token to replace imprimitive attribute string (#169)

Changed

  • Upgrade Node and dependent packages to the latest version (#172)

Deprecated

  • Dot notation path for meta property in ThemeSet#getThemeProp is deprecated in favor of using added ThemeSet#getThemeMeta (#171)

v1.1.0 - 2019-06-03

Added

  • Allow passing markdown-it instance as markdown constructor option (#164)
  • Add size argument for split background (#166, #168)

Fixed

  • Fix color shorthand detection to use the value before of validation (#165)

Changed

  • Upgrade dependent packages to the latest version (#167)

Deprecated

  • A plugin interface for markdown-it (markdownItPlugins) is deprecated (#164)

v1.0.0 - 2019-05-05

Breaking

  • Marpit requires Node >= 8.

Added

Changed

  • Use browser-sync instead of docsify-cli to serve docs on local (#157)
  • Upgrade dependent packages to the latest version (#158)
  • Swap Sass compiler for document from node-sass to Dart Sass (#158)

Removed

  • Drop support for Node 6.x (#139, #155)
  • Remove deprecated constructor options: backgroundSyntax, filters, inlineStyle, and scopedStyle (#156)

v0.9.2 - 2019-04-08

Fixed

  • Update slide plugin and heading divider plugin to apply the correct mapped line of slides (#151)

v0.9.1 - 2019-04-05

Added

  • Allow parsing hyphen and underscore in theme meta (#150)
  • Support getting nested prop by ThemeSet#getThemeProp (#150)

v0.9.0 - 2019-04-03

Added

  • Parse lists in * and 1) marker as fragmented list (#145, #148)

Changed

  • Upgrade dependent packages to the latest version (#143, #149)
  • Simplify Marpit plugins by using injected instance into markdown-it instance (#147)

Deprecated

  • Mark unused constructor options as deprecated: backgroundSyntax, filters, inlineStyle, and scopedStyle (#144)

Removed

  • Enhanced plugin system (#146)

v0.8.0 - 2019-03-13

Added

  • Direction keyword for advanced background (#138)

Changed

  • Upgrade Node and dependent packages to the latest version (#140)

v0.7.2 - 2019-02-13

Fixed

  • Use re-exported markdown-it Token from state (#132)
  • Fix broken emoji on docs (#134)

Changed

  • Upgrade dependent packages to the latest version (#133)

v0.7.1 - 2019-02-04

Fixed

  • Fix type definition of custom directive parser to allow array and object (#130)

Changed

  • Upgrade Node and dependent packages to the latest version (#131)

v0.7.0 - 2019-01-30

Added

  • Make custom directives definable via customDirectives member (#124, #125, #128)
  • Enhance plugin system to control Marpit features (#127)

Changed

  • Update printable plugin to use CSS Fragmentation to control page break (#126)
  • Upgrade dependent packages to latest version (#129)

v0.6.1 - 2019-01-25

Fixed

  • Include inline SVG elements when rendered with htmlAsArray env (#123)

Changed

  • Small update for README and docs (#122)

v0.6.0 - 2019-01-19

Added

  • Add env argument to Marpit.render() (#118)
  • Output HTML per slide page as array by passing htmlAsArray env (#112, #119)
  • Update docs to explain SVG slide polyfill (#117)
  • Update docs to explain usage of plugin (#120)

Changed

  • Upgrade dependent packages to latest version (#121)

v0.5.0 - 2018-12-28

Added

  • Support setting background color by Markdown image syntax (#92, #113)
  • Add data-marpit-svg attribute to SVG element outputted by inline SVG mode (#115)

Fixed

  • Fix remaining orphan break by sweeping hidden inline token forcibly (#114)

Changed

  • Upgrade Node and dependent packages to latest version (#116)

v0.4.1 - 2018-12-18

Fixed

  • Prevent leaking header and footer when printing by added normalization of HTML background (#108, #109)
  • Fix the version badge in docs sidebar (#110)

Changed

  • Upgrade Node and dependent packages to latest version (#111)

v0.4.0 - 2018-12-02

Added

  • Add use method to extend markdown-it parser by plugin (#105)

Changed

  • Upgrade dependent packages to latest version (#106)

v0.3.3 - 2018-11-30

Fixed

  • Revert resolutions for ajv (#102)
  • Fix over-scoped selectors injected by printable plugin (#104)

Added

  • Run yarn audit while running CI / publish processes (#103)

v0.3.2 - 2018-11-29

Fixed

  • Disable CSS scoping into declarations within @keyframes at-rule (#97, #99)

Changed

  • Disable styling html and body elements through theme CSS (#98, #100)
  • Upgrade dependent packages to latest version (#101)

v0.3.1 - 2018-11-24

Security

  • Upgrade dependent packages to prevent the malicious attack in dependencies (#96)

v0.3.0 - 2018-11-14

Breaking

  • No longer work with Node v6.14.2 and v6.14.3 (#93)

Added

  • Add docsify style and its build script (#91, #93)
  • Support the scoped inline style through <style scoped> (#85, #94)

Changed

  • Upgrade dependent packages to latest version (#95)

v0.2.1 - 2018-11-05

Changed

  • Support Node 10.x and use its LTS for development (#84, #88)
  • Upgrade dependent packages to latest version (#90)

Fixed

  • Fix docs to work docsify scripts correctly (#89)

Removed

  • Remove defer attribute from <inline> script tag on docs (#87)

v0.2.0 - 2018-10-10

Added

  • Collect HTML comments per page to be usable as presenter note (#82, #83)

Changed

  • Update license author to marp-team (#81)

v0.1.3 - 2018-10-05

Fixed

  • Improve conversion performance by using for-of loop (40-70% faster) (#79)

Changed

  • Upgrade dependent packages to latest version (#80)

v0.1.2 - 2018-09-20

Fixed

Changed

  • Upgrade devDependencies to latest version (#78)

v0.1.1 - 2018-09-18

Fixed

  • Fix that before option of ThemeSet.pack breaks importing another theme (#71, #72)

v0.1.0 - 2018-09-14

Breaking

  • Rename lazyYAML constructor option into looseYAML (#68)

Added

Changed


<summary>History of pre-release versions</summary>

v0.0.15 - 2018-09-06

Fixed

  • Improve rendering header and footer to use inline tokens (#66)

v0.0.14 - 2018-09-02

Added

Changed

  • Upgrade Babel to 7 stable (#64)
  • Update Marpit API URL to use own domains (#59)

v0.0.13 - 2018-08-27

Added

  • Support CSS scoping by element id (#57)

Fixed

  • Improve type definition about slide containers, theme metas, and internal variables (#56, #58)

v0.0.12 - 2018-08-18

Removed

  • Remove Unicode Emoji support due to many issues on stable Chrome (#53)

Changed

  • Improve lazy YAML parsing to apply in defined directives only (#54)
  • Upgrade Node LTS and depenent packages (#55)

v0.0.11 - 2018-08-12

Added

  • Lazy yaml support by lazyYAML option (#49)
  • Support class directive defined by array (#51)
  • Parse inline comment (#52)

Fixed

  • Bugfix: Pass class attribute to pseudo section on advanced background (#48)

Changed

v0.0.10 - 2018-08-05

Breaking

Changed

  • Mark Marpit's options property as immutable (#46)
  • Migrate test framework from mocha to jest (#43)
  • Migrate CI from Travis CI to CircleCI (#44)

v0.0.9 - 2018-07-23

Added

  • Add the basic TypeScript definition (#40)
  • Support heading divider (#41)

Changed

  • Upgrade Node LTS and depenent packages (#42)

v0.0.8 - 2018-06-28

Added

  • Support Unicode 11.0 emoji (#39)

Fixed

  • Apply color style to pseudo layer of advanced backgrounds (#37)
  • Fix JSDoc: Missing color prop in the definition of local directives (#38)

v0.0.7 - 2018-06-04

Added

  • Support backgroundColor and color local directives (#32)

Fixed

  • Suppress confusable theme import when tweaking (#33)

Removed

  • Remove workaround flag support from Marpit's inlineSVG option (#35)

v0.0.6 - 2018-05-29

Added

  • Add header and footer directives (#22)
  • Support importing other theme CSS with @import (or @import-theme) (#24)
  • Support tweaking theme style through <style> element or style global directive (#25)
  • Add PostCSS import rollup plugin to work @charset and @import at-rules correctly (#26)

Fixed

  • Fix over-stripped comments in the inline code (#28)
  • Hide section::after pseudo-element without pagination (#29)

Changed

  • Change role of pagination layer to pseudo layer on advanced background (#27)

v0.0.5 - 2018-05-12

Added

  • Add paginate local directive (#17)
  • Make Unicode emoji printable (#18)

Security

  • Prevent style injections (#19)

v0.0.4 - 2018-05-05

Added

  • Implement CSS filter for image and advanced backgrounds (#14)
  • Implement split backgrounds in advanced background mode (#16)

Fixed

  • Fix PostCSS printable plugin to allow printing the advanced backgrounds (#15)

v0.0.3 - 2018-05-02

Added

  • Implement background image resizing with keyword and scale (#10)
  • Support advanced background mode with inline SVG, for multiple images and filters (#11)
  • Update docs about background images (#13)

Changed

  • Upgrade node to the latest LTS version v8.11.1 (#12)

v0.0.2 - 2018-04-28

Added

Changed

  • Improve the sweep logic of blank paragraphs by split into another plugin (#8)

v0.0.1 - 2018-03-28

Added

  • Add JSDoc about Marpit class

Changed

  • Optional inline SVG workaround (#1)
  • Split the injection of markdown-it plugins and provide interface of markdown-it plugin (#2)
  • Split rendering style into Marpit#renderStyle (#3)

v0.0.0 - 2018-03-24

  • Initial release. It does not cover integration test and document fully.