marp-vscode

marp-teamMIT活跃维护

在 VS Code 里用 Marp Markdown 语法直接写幻灯片,支持实时预览和导出,省去切换工具的麻烦。

Marp for VS Code: Create slide deck written in Marp Markdown on VS Code

v3.6.1发布于 2026-08-11 11:46 UTC2,106star140fork同步于 2026-11-07 07:32 UTC

怎么上手

由 README 提炼,执行前请确认
在 VS Code 扩展市场安装 Marp for VS Code,然后在 Markdown 文件头部写入:
---
marp: true
---
硬件要求按 README 说明

README 未说明;导出 PDF、PPTX 和图片需本机安装 Chrome、Chromium、Edge 或 Firefox 之一

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

在 VS Code 里用 Marp Markdown 写幻灯片并实时预览、导出,省去切换工具

在 VS Code 里用 Marp Markdown 语法直接写幻灯片,支持实时预览和导出,省去切换工具的麻烦。

核心能力

  • 用 marp: true 开启预览与语法高亮
  • 为 Marp 指令提供补全、悬停帮助和诊断
  • 集成 Marp CLI 导出 HTML、PDF、PPTX 和图片
  • 支持注册自定义主题 CSS 并自动热重载
  • 扩展大纲视图,按幻灯片分页并支持折叠

容易踩的坑

导出 PDF、PPTX 和图片必须额外安装 Chrome、Chromium、Edge 或 Firefox 之一;旧设置 markdown.marp.chromePath 自 v2 起弃用,应改用 markdown.marp.browserPath;PNG 和 JPEG 导出只包含第一张幻灯片

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v3.6.1
  1. v3.6.1最新正式版2026-08-11 · 2026-08-11 11:46 UTC

    Fixed

    • Hide copy buttons in every code block provided by the VS Code preview when the Marp preview is enabled (#573, #574)

    Changed

    • Upgrade Node.js and dependent packages (#575)
  2. v3.6.02026-07-18 · 2026-07-18 06:01 UTC
    查看更新说明

    Changed

    • Upgrade Marp Core to v4.4.0 (#571)
      • It may introduce a minor breaking change in the custom style for gaia theme. Check out this PR.
    • Upgrade Marp CLI to v4.5.0 (#571)
      • Improved PDF rendering compatibility with macOS Firefox ("markdown.marp.browser": "firefox")
    • Upgrade Node.js and dependent packages (#571)
  3. v3.5.22026-07-04 · 2026-07-04 19:10 UTC
    查看更新说明

    Changed

    • Upgrade Marp Core to v4.3.1 (#569)
      • Including Marpit v3.2.2: Make <h1> style normalization overloadable using the universal selector * (#549)
    • Upgrade Marp CLI to v4.4.1 (#562, #569)
    • Upgrade Node.js and dependent packages (#569)

    Security

    • Fix theme path traversal check incorrectly passing for specific directory structures (#567, #568)
  4. v3.5.12026-05-04 · 2026-05-04 08:13 UTC
    查看更新说明

    Fixed

    • Fix broken bundle on Windows by making the open module an external dependency (#559, #561)
  5. v3.5.02026-05-03 · 2026-05-03 19:11 UTC
    查看更新说明

    Added

    • Experimental markdown.marp.openExportedHtmlInIntegratedBrowser setting to open exported HTML in VS Code's integrated browser (#555)

    Changed

    • Upgrade Node.js and dependent packages (#557)

    Fixed

    • Fix auto-open failure on Windows when a file path contains non-ASCII characters (#516, #556, #558)

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Marp for VS Code

    CircleCI Codecov Visual Studio Marketplace Open VSX LICENSE

    Create slide deck written in Marp Markdown on VS Code.

    We will enhance your VS Code as the slide deck writer. Mark marp: true, and write your deck!

    See the documentation of Marpit Markdown and the features of Marp Core about how to write.

    Please refer https://marp.app/ for more details of Marp ecosystem. We have powerful tools for Marp Markdown: Marpit Framework, Marp Core, CLI tool and so on.

    Usage

    Marp features will be enabled when marp: true is written in a front-matter of Markdown document.

    ---
    marp: true
    ---
    
    # Your slide deck
    
    Start writing!
    

    You can create a new Marp Markdown document from "New File..." menu (Alt + Ctrl + Win + N / Alt + Cmd + Ctrl + N) to start writing a slide deck quickly.

    marp: true also can toggle by opening the quick picker from toolbar icon and selecting "Toggle Marp feature for current Markdown". (markdown.marp.toggleMarpFeature).

    Features

    Preview Marp Markdown

    While enabled Marp features by marp: true, Marp for VS Code can preview your Marp Markdown with the same way as a built-in Markdown preview.

    In the preview, an active slide is highlighted based on the current position of the editor, as like as the regular Markdown preview. To disable this highlight, you can set markdown.preview.markEditorSelection setting to false.

    [!NOTE] If you are not familiar with editing Markdown on VS Code, we recommend to learn what you can do in VS Code documentation at first.

    IntelliSense for Marp directives

    Directives, the inherited feature from Marpit framework, is an important syntax to write the deck in Marp.

    If enabled Marp feature by marp: true, Marp for VS Code extends IntelliSense to support auto completion, syntax highlight, hover help, and diagnostics for Marp directives.

    Auto completion

    Marp for VS Code can suggest global/local directives supported by Marp ecosystem. We remember all so you may forget them! 😛

    Hit Ctrl + Space within the front-matter or HTML comment to show the list of directives. You can peek the help of selected directive by hitting Ctrl + Space again.

    Some directives such as theme and paginate are also supported auto completion for the value.

    Highlight and hover help

    The key of recognized directives are highlighted in the different color from the around. This visualization may help to find out meaningless definitions.

    And you can see the help of a defined directive by hovering cursor on the recognized directive.

    Diagnostics

    Marp for VS Code can detect some basic problems in Marp directives. Diagnostics will help following our recommended way for writing slides.

    NameDescriptionQuick Fix
    define-math-global-directiveRecommend to declare math typesetting library via math global directive✅
    deprecated-color-setting-shorthandCheck obsoleted shorthands for setting slide colors✅
    deprecated-dollar-prefixCheck obsoleted directives prefixed by $✅
    ignored-math-global-directiveReport ignored math global directive if disabled math by the extension setting
    overloading-global-directiveFind out overloaded global directives
    unknown-sizeNotify if the specified size preset was not defined in a theme
    unknown-themeNotify a not recognized theme name
    Experimental diagnostics

    Some of diagnostics are experimental. You can enable or disable them in the extension settings. Refer to "Experimental settings".

    NameDescriptionQuick Fix
    🧪 slide-content-overflowWarn when the slide content in a preview overflows the safe area defined by the slide’s padding

    Export slide deck to HTML, PDF, PPTX, and image 🛡️

    We have integrated Marp CLI to export your deck into several formats.

    To export the content of active Markdown editor, open the quick pick from Marp icon on toolbar and select "Export slide deck...". (markdown.marp.export)

    You can also execute command from the Command Palette (F1 or Ctrl/Cmd+Shift+P).

    Supported file types
    • HTML
    • PDF
    • PPTX (PowerPoint document)
    • PNG (First slide only)
    • JPEG (First slide only)
    • TXT (Notes only)

    Default file type can choose by the markdown.marp.exportType setting.

    [!IMPORTANT] Exporting PDF, PPTX, and image formats requires to install any one of Google Chrome, Chromium, Microsoft Edge, or Firefox. You may control using browser and the custom path for the browser by markdown.marp.browser and markdown.marp.browserPath settings.

    [!NOTE] A legacy setting markdown.marp.chromePath is deprecated since v2. Please use markdown.marp.browserPath instead.

    Integration with AI agent

    Marp for VS Code also provides the export tool to VS Code built-in AI agent.

    By instructing in chat to export Markdown in the specified file format, AI agent can process the export using preferences in the current workspace.

    Use custom theme CSS 🛡️

    You can register and use custom theme CSS for Marpit / Marp Core by setting markdown.marp.themes, that includes remote URLs, or relative paths to local files in the current workspace.

    // Please put `.vscode/settings.json` on your workspace
    {
      "markdown.marp.themes": [
        "https://example.com/foo/bar/custom-theme.css",
        "./themes/your-theme.css"
      ]
    }
    

    It's very similar to a way for using custom styles in ordinary Markdown preview. The registered theme can use by specifying theme name in theme global directive.

    /* @theme your-theme */
    
    @import 'default';
    
    section {
      background: #fc9;
    }
    
    ---
    marp: true
    theme: your-theme
    ---
    
    # Use your own theme
    

    Markdown preview will reload updated theme CSS automatically when you edited the registered local CSS file. It's very useful for creating your own theme.

    Outline extension

    When Marp Markdown is enabled, you can use the extended outline view like following. They are enabled by default but you may disable by the markdown.marp.outlineExtension setting.

    Outline view for each slide

    We extend the outline view to support slide pages in Marp Markdown.

    [!TIP]

    Please choose Sort By: Position from context menu of its panel if you see incorrect slide order.

    Slide folding in editor

    You can fold the content of slide in editor while editing Marp Markdown.

    Security

    Workspace Trust

    Some features that may met malicious are restricted in the untrusted workspace/window. Please read VS Code's user guide for details.

    Features may be restricted are marked by the shield icon 🛡️ in this documentation. Marp for VS Code is available even if the current workspace is not trusted but you can use only a basic Marp preview and IntelliSense.

    HTML elements in Markdown 🛡️

    In the trusted workspace, if Marp Markdown was included HTML elements, only selectivity HTML elements by Marp can render by default. You can control which HTML elements will be rendered by setting the markdown.marp.html option,

    You can control which HTML elements will be rendered by setting the markdown.marp.html option. You can set it as all to allow all HTML elements, but could allow script injection from untrusted Markdown files. Use with caution.

    In the untrusted workspace, HTML elements in Marp Markdown will be always ignored regardless of the selected option in markdown.marp.html.

    [!NOTE] A legacy setting markdown.marp.enableHtml is deprecated since v2. Please use markdown.marp.html instead.

    Experimental settings

    Some of settings are marked as experimental. These feature may be unstable and change the spec in the future.

    markdown.marp.diagnostics.slideContentOverflow

    Enables a diagnostic that warns when slide content overflows the safe area defined by the slide’s padding. This diagnostic is only available while the Markdown preview is open.

    It is helpful for identifying some potential presentation issues, such as cropped content, excessive content on a single page, and an unnatural layouts.

    markdown.marp.openExportedHtmlInIntegratedBrowser

    Use VS Code integrated browser to open the exported HTML file when markdown.marp.exportAutoOpen setting is enabled. It requires VS Code v1.109 and later. This allows users to play presentations in VS Code tabs or external windows.

    • off: The exported HTML will open in the external browser app.
    • tab: The exported HTML will open in VS Code integrated browser as a new tab.
    • window: The exported HTML will open in VS Code integrated browser as a new window.

    Key features provided by the Marp CLI bespoke template, such as fragmented list support, presenter view, and transitions, also work in the VS Code integrated browser.

    markdown.marp.pptx.editable

    You can enable the experimental feature to export PPTX with editable contents, based on Marp CLI's corresponding experimental option. This feature requires to install both of the compatible browser and LibreOffice Impress.

    If set this setting as smart, Marp for VS Code will try to export into editable PPTX first, and then fall back to the regular PPTX export (non-editable) if failed.

    markdown.marp.strictPathResolutionDuringExport

    This experimental setting is useful to improve the export result compatibility with VS Code preview. If enabled, the export command will try to resolve relative paths in Markdown from VS Code workspace that a Markdown file belongs.

    If disabled, or the Markdown does not belong to any workspace, the export command will resolve paths based on the local file system. This behavior is same as Marp CLI.

    Web extension

    You can use Marp extension in VS Code for the Web environment like vscode.dev and github.dev. Try opening https://github.dev/marp-team/marp-vscode/blob/main/docs/example.md, with an environment that has installed Marp extension.

    The web extension has some limitations:

    • Export command cannot use because it is depending on Marp CLI that is not designed for Web. Please use VS Code that is installed to your local environment, or use either VS Code Server or GitHub Codespaces if you wanted an environment working on Web.

    Contributing

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

    Author

    Managed by @marp-team.

    License

    This extension releases under the MIT License.