========================
CODE SNIPPETS
========================
TITLE: Marp CLI File-Based Configuration Example
DESCRIPTION: Example JSON configuration for Marp CLI, demonstrating how to customize engine constructor options like disabling line breaks conversion in Markdown and preventing minification of rendered theme CSS for easier debugging.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/README.md#_snippet_39
LANGUAGE: JSON
CODE:
```
{
"options": {
"markdown": {
"breaks": false
},
"minifyCSS": false
}
}
```
----------------------------------------
TITLE: Install Marp CLI via Package Managers
DESCRIPTION: Instructions for installing Marp CLI using Homebrew on macOS and Scoop on Windows. These methods leverage community-maintained package manifests for easy installation and updates.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/README.md#_snippet_2
LANGUAGE: bash
CODE:
```
brew install marp-cli
```
LANGUAGE: cmd
CODE:
```
scoop install marp
```
----------------------------------------
TITLE: Install and Verify Marp Core Version
DESCRIPTION: This snippet demonstrates how to install a specific version of `@marp-team/marp-core` as a development dependency alongside `@marp-team/marp-cli` and then verify that Marp CLI is using the user-installed core version.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/README.md#_snippet_34
LANGUAGE: console
CODE:
```
$ npm i @marp-team/marp-cli @marp-team/marp-core@^4.0.0 --save-dev
$ npx marp --version
```
----------------------------------------
TITLE: Install Marp CLI Locally with npm
DESCRIPTION: Guide to installing Marp CLI as a development dependency within a Node.js project. This allows precise version control and usage via npm-scripts or `npx marp`, requiring Node.js v18+.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/README.md#_snippet_3
LANGUAGE: bash
CODE:
```
npm install --save-dev @marp-team/marp-cli
```
----------------------------------------
TITLE: Install Marp CLI Globally with npm
DESCRIPTION: Instructions for a global installation of Marp CLI using npm. This makes the `marp` command available system-wide, requiring Node.js v18+.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/README.md#_snippet_4
LANGUAGE: bash
CODE:
```
npm install -g @marp-team/marp-cli
```
----------------------------------------
TITLE: Marp CLI defineConfig Helper for Configuration
DESCRIPTION: JavaScript example demonstrating the use of Marp CLI's `defineConfig` helper function. This utility provides type-safe configuration with auto-completion, similar to patterns found in build tools like Vite.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/README.md#_snippet_41
LANGUAGE: JavaScript
CODE:
```
import { defineConfig } from '@marp-team/marp-cli'
export default defineConfig({
// ...
})
```
----------------------------------------
TITLE: Convert with Bare Template and Marpit Engine in Marp CLI
DESCRIPTION: This example shows how to convert a slide deck using the minimalist 'bare' template while explicitly setting the conversion engine to @marp-team/marpit. This configuration results in a presentation that does not rely on JavaScript.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/README.md#_snippet_21
LANGUAGE: bash
CODE:
```
marp --template bare --engine @marp-team/marpit slide-deck.md
```
----------------------------------------
TITLE: Marp CLI JSDoc Type Annotation for Configuration
DESCRIPTION: JavaScript example showing how to use JSDoc with Marp CLI's `Config` type. This annotation provides IntelliSense and auto-completion for configuration objects in editors like VS Code when Marp CLI is installed locally.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/README.md#_snippet_40
LANGUAGE: JavaScript
CODE:
```
/** @type {import('@marp-team/marp-cli').Config} */
const config = {
// ...
}
export default config
```
----------------------------------------
TITLE: Configure Marp CLI in package.json
DESCRIPTION: This example shows how to define Marp CLI options within the `marp` section of your `package.json` file. This method is useful for configuring project-wide settings such as input directory for slides, output directory for generated files, and the location of custom themes.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/README.md#_snippet_35
LANGUAGE: javascript
CODE:
```
// package.json
{
"marp": {
"inputDir": "./slides",
"output": "./public",
"themeSet": "./themes"
}
}
```
----------------------------------------
TITLE: Convert Marp Markdown with npx
DESCRIPTION: Use `npx` to convert Marp Markdown files into HTML, PDF, or PPTX, or to run in watch/server mode. This method allows one-shot conversions without a global installation, requiring Node.js v18+ and a browser.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/README.md#_snippet_0
LANGUAGE: bash
CODE:
```
npx @marp-team/marp-cli@latest slide-deck.md
npx @marp-team/marp-cli@latest slide-deck.md -o output.html
npx @marp-team/marp-cli@latest slide-deck.md --pdf
npx @marp-team/marp-cli@latest slide-deck.md -o output.pdf
npx @marp-team/marp-cli@latest slide-deck.md --pptx
npx @marp-team/marp-cli@latest slide-deck.md -o output.pptx
npx @marp-team/marp-cli@latest -w slide-deck.md
npx @marp-team/marp-cli@latest -s ./slides
```
----------------------------------------
TITLE: Use Marpit Framework as Conversion Engine in Marp CLI
DESCRIPTION: Shows how to install the `@marp-team/marpit` framework and specify it as the conversion engine for Marp CLI using the `--engine` option. Note that Marpit itself does not provide themes, requiring inline styles or external CSS.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/README.md#_snippet_27
LANGUAGE: bash
CODE:
```
# Install Marpit framework
npm i @marp-team/marpit
```
LANGUAGE: bash
CODE:
```
# Specify engine to use Marpit
marp --engine @marp-team/marpit marpit-deck.md
```
----------------------------------------
TITLE: Integrate markdown-it-mark Plugin with Marp CLI Functional Engine
DESCRIPTION: Provides a practical example of integrating the `markdown-it-mark` plugin using a functional engine. This enables the `==marked==` syntax in Markdown, which converts to `marked` in the output.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/README.md#_snippet_32
LANGUAGE: javascript
CODE:
```
// engine.mjs
import markdownItMark from 'markdown-it-mark'
export default ({ marp }) => marp.use(markdownItMark)
```
LANGUAGE: bash
CODE:
```
# Install markdown-it-mark into your project
npm i markdown-it-mark --save
```
LANGUAGE: bash
CODE:
```
# Specify the path to functional engine
marp --engine ./engine.mjs slide-deck.md
```
----------------------------------------
TITLE: Override Marp CLI Output Theme
DESCRIPTION: This example demonstrates how to change the default visual theme for a Marp CLI conversion. By using the --theme option, users can specify a built-in theme like 'gaia' to customize the appearance of their generated presentation.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/README.md#_snippet_24
LANGUAGE: bash
CODE:
```
marp --theme gaia
```
----------------------------------------
TITLE: Customize Marp Engine with ES Module Config
DESCRIPTION: This example demonstrates how to customize the Marp engine directly within an ES Module configuration file (`marp.config.mjs`). It shows importing a `markdown-it-container` plugin and applying it to the Marp instance, allowing for advanced engine modifications.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/README.md#_snippet_37
LANGUAGE: javascript
CODE:
```
// marp.config.mjs
import markdownItContainer from 'markdown-it-container'
export default {
// Customize engine on configuration file directly
engine: ({ marp }) => marp.use(markdownItContainer, 'custom'),
}
```
----------------------------------------
TITLE: Define Functional Engine (CommonJS) for Marp CLI
DESCRIPTION: Provides an example of a CommonJS functional engine that exports a function. This function receives constructor options and should return an instance of a Marpit-based engine initialized with those options.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/README.md#_snippet_29
LANGUAGE: javascript
CODE:
```
// engine.cjs (CommonJS)
const { MarpitBasedEngine } = require('marpit-based-engine')
module.exports = function (constructorOptions) {
// Return an instance of Marpit initialized by passed constructor options
return new MarpitBasedEngine(constructorOptions)
}
```
----------------------------------------
TITLE: Marp CLI: Generate Editable PowerPoint (PPTX) - Experimental
DESCRIPTION: This experimental snippet shows how to generate an editable PowerPoint document from a Markdown slide deck. It requires both the `--pptx` and `--pptx-editable` options, and also necessitates the installation of LibreOffice Impress. Note that this option may result in lower slide reproducibility and does not support presenter notes.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/README.md#_snippet_9
LANGUAGE: bash
CODE:
```
marp --pptx --pptx-editable slide-deck.md
```
----------------------------------------
TITLE: Define Functional Engine (ES Modules) for Marp CLI
DESCRIPTION: Provides an example of an ES module functional engine that exports a class inherited from Marpit as the default export. This allows for highly customized conversion logic.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/README.md#_snippet_28
LANGUAGE: javascript
CODE:
```
// engine.mjs (ES modules)
import { MarpitBasedEngine } from 'marpit-based-engine'
export default () => MarpitBasedEngine // Return a class inherited from Marpit
```
----------------------------------------
TITLE: Configure Marp CLI server port
DESCRIPTION: When running Marp CLI in server mode, you can set the listening port by defining the `PORT` environment variable before executing the command. This example sets the server to listen on port 5000.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/README.md#_snippet_15
LANGUAGE: bash
CODE:
```
PORT=5000 marp -s ./slides
```
----------------------------------------
TITLE: Enable HTML Attributes for Morphing in Marp CLI
DESCRIPTION: This snippet shows the command-line option required to enable rendering of raw HTML `data-*` attributes in Marp CLI, which is necessary for the `data-morph` based morphing animation example to function correctly due to security reasons.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/docs/bespoke-transitions/README.md#_snippet_13
LANGUAGE: Bash
CODE:
```
marp morphable.md --html
```
----------------------------------------
TITLE: Pull Marp CLI Container Image
DESCRIPTION: Commands to pull the official Marp CLI container image from Docker Hub and GitHub Container Registry. This provides a self-contained environment, eliminating the need for local Node.js or browser installations.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/README.md#_snippet_1
LANGUAGE: bash
CODE:
```
docker pull marpteam/marp-cli
```
LANGUAGE: bash
CODE:
```
docker pull ghcr.io/marp-team/marp-cli
```
----------------------------------------
TITLE: Set explicit browser executable path for Marp CLI
DESCRIPTION: If Marp CLI cannot automatically locate your browser binary, use the `--browser-path` option to explicitly provide the path to the executable. This is useful for custom browser installations or Chromium-flavored browsers.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/README.md#_snippet_17
LANGUAGE: bash
CODE:
```
# Use Chromium-flavored browser (Chromium, Brave, Vivaldi, etc...)
marp --browser-path /path/to/chromium-flavored-browser ./slide.md -o slide.pdf
# Use Firefox with explicitly set path
marp --browser firefox --browser-path /path/to/firefox ./slide.md -o slide.png
```
----------------------------------------
TITLE: Animate Layer Order with z-index for Marp Transitions in CSS
DESCRIPTION: This example demonstrates how to animate the `z-index` property to dynamically swap the order of layers during a Marp transition, enabling more complex visual effects. It shows a `swap` transition where the incoming slide moves from back to front at 50% of the animation duration, while both slides also translate horizontally.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/docs/bespoke-transitions/README.md#_snippet_10
LANGUAGE: CSS
CODE:
```
/** Declare `swap` transition */
@keyframes marp-incoming-transition-swap {
/* Incoming slide will swap from back to front at 50% of animation */
from {
z-index: -1;
}
to {
z-index: 0;
}
/* Declarations for moving animation */
0% {
transform: translateX(0);
}
50% {
transform: translateX(50%);
}
100% {
transform: translateX(0);
}
}
@keyframes marp-outgoing-transition-swap {
0% {
transform: translateX(0);
}
50% {
transform: translateX(-50%);
}
100% {
transform: translateX(0);
}
}
```
----------------------------------------
TITLE: Prevent Backward Transition Fallback with Empty Keyframes in CSS
DESCRIPTION: This example illustrates how to prevent Marp CLI from falling back to normal keyframes during backward navigation when a specific backward animation is not desired. It achieves this by declaring an empty `@keyframes` block for the backward animation, demonstrated with a `zoom-out` transition.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/docs/bespoke-transitions/README.md#_snippet_7
LANGUAGE: CSS
CODE:
```
/* Define `zoom-out` transition */
@keyframes marp-outgoing-transition-zoom-out {
from {
transform: scale(1);
}
to {
transform: scale(0);
}
}
@keyframes marp-incoming-transition-zoom-out {
/* Send the layer for new slide to back (See also "Layer order") */
from,
to {
z-index: -1;
}
}
@keyframes marp-outgoing-transition-backward-zoom-out {
/****** Declare empty keyframes to disable fallback ******/
}
@keyframes marp-incoming-transition-backward-zoom-out {
from {
transform: scale(0);
}
to {
transform: scale(1);
}
}
```
----------------------------------------
TITLE: Mark Morphable Content Using HTML data-morph Attribute in Marp
DESCRIPTION: This example illustrates how to define morphable elements using custom HTML `data-morph` attributes within Marp Markdown. It leverages the advanced `attr()` CSS function to dynamically set `view-transition-name` based on the `data-morph` attribute, allowing for flexible morphing of elements like text bars. It notes the requirement for Chrome 133+ and the need for the `--html` CLI option.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/docs/bespoke-transitions/README.md#_snippet_12
LANGUAGE: Markdown
CODE:
```
---
header: Bubble sort
transition: fade
style: |
/* Define the style of morphable elements (Requires Chrome 133 and later) */
[data-morph] {
view-transition-name: attr(data-morph type(), none);
}
/* Global style */
section {
font-size: 60px;
}
---
███████ 7
█████ 5
███ 3
█████████ 9
---
█████ 5
███████ 7
███ 3
█████████ 9
---
█████ 5
███ 3
███████ 7
█████████ 9
---
███ 3
█████ 5
███████ 7
█████████ 9
```
----------------------------------------
TITLE: Marp CLI Configuration Options Reference
DESCRIPTION: This section provides a detailed reference for all configurable options in Marp CLI, outlining their data types, associated command-line arguments, and a clear explanation of their functionality and usage.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/README.md#_snippet_47
LANGUAGE: APIDOC
CODE:
```
Option: allowLocalFiles
Type: boolean
CLI Option: --allow-local-files
Description: Allow to access local files from Markdown while converting PDF (NOT SECURE)
Option: author
Type: string
CLI Option: --author
Description: Define author of the slide deck
Option: bespoke
Type: object
Description: Setting options for bespoke template
Properties:
osc:
Type: boolean
CLI Option: --bespoke.osc
Description: [Bespoke] Use on-screen controller (true by default)
progress:
Type: boolean
CLI Option: --bespoke.progress
Description: [Bespoke] Use progress bar (false by default)
transition:
Type: boolean
CLI Option: --bespoke.transition
Description: [Bespoke] Use [transitions] (Only in browsers supported [View Transition API]: true by default)
Option: browser
Type: string | string[]
CLI Option: --browser
Description: The kind of browser for conversion (auto by default)
Option: browserPath
Type: string
CLI Option: --browser-path
Description: Path to the browser executable
Option: browserProtocol
Type: cdp | webdriver-bidi
CLI Option: --browser-protocol
Description: Set the preferred protocol for connecting to the browser (cdp by default)
Option: browserTimeout
Type: number
CLI Option: --browser-timeout
Description: Set the timeout for each browser operation in seconds (30 by default)
Option: description
Type: string
CLI Option: --description
Description: Define description of the slide deck
Option: engine
Type: string | Class | Function
CLI Option: --engine
Description: Specify Marpit based engine
Option: html
Type: boolean | object
CLI Option: --html
Description: Enable or disable HTML tags (Configuration file can pass [the whitelist object] if you are using Marp Core)
Option: image
Type: png | jpeg
CLI Option: --image
Description: Convert the first slide page into an image file
Option: images
Type: png | jpeg
CLI Option: --images
Description: Convert slide deck into multiple image files
Option: imageScale
Type: number
CLI Option: --image-scale
Description: The scale factor for rendered images (1 by default, or 2 for PPTX conversion)
Option: inputDir
Type: string
CLI Option: --input-dir -I
Description: The base directory to find markdown and theme CSS
Option: jpegQuality
Type: number
CLI Option: --jpeg-quality
Description: Setting JPEG image quality (85 by default)
Option: keywords
Type: string | string[]
CLI Option: --keywords
Description: Define keywords for the slide deck (Accepts comma-separated string and array of string)
Option: lang
Type: string
CLI Option: (None)
Description: Define the language of converted HTML
Option: notes
Type: boolean
CLI Option: --notes
Description: Convert slide deck notes into a text file
Option: ogImage
Type: string
CLI Option: --og-image
Description: Define [Open Graph] image URL
Option: options
Type: object
CLI Option: (None)
Description: The base options for the constructor of engine
Option: output
Type: string
CLI Option: --output -o
Description: Output file path (or directory when input-dir is passed)
```
----------------------------------------
TITLE: Marp CLI Bespoke Template Features Overview
DESCRIPTION: This documentation outlines the various interactive and presentation features provided by the 'bespoke' HTML template. Features include navigation, fullscreen toggle, an on-screen controller, fragmented list support, presenter view, and optional progress bar.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/README.md#_snippet_20
LANGUAGE: APIDOC
CODE:
```
Navigation: Navigate the deck through keyboard and swipe geasture.
Fullscreen: Toggle fullscreen by hitting f / F11 key.
On-screen controller: There is a touch-friendly OSC. You may also disable by --bespoke.osc=false if unnecessary.
Fragmented list: Recognize Marpit's fragmented list and appear list one-by-one if used * and 1) as the bullet marker.
Presenter view: Open presenter view in external window by hitting p key. (It may become disabled when not fulfilled requirements for working)
Progress bar (optional): By setting --bespoke.progress option, you can add a progress bar on the top of the deck.
Slide transitions: Support transitions (transition local directive) powered by View Transition API.
```
----------------------------------------
TITLE: Check Marp CLI and Engine Version
DESCRIPTION: Explains how to use the `--version` or `-v` option to confirm the versions of both Marp CLI and the currently configured conversion engine.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/README.md#_snippet_33
LANGUAGE: console
CODE:
```
$ marp --version
@marp-team/marp-cli v4.x.x (w/ @marp-team/marp-core v4.x.x)
```
----------------------------------------
TITLE: Marp CLI Metadata Configuration via CLI Options
DESCRIPTION: This table details the command-line options available in Marp CLI for defining metadata. These options allow users to set properties like title, description, author, keywords, URL, and Open Graph image for the generated HTML, PDF, and PPTX outputs.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/README.md#_snippet_22
LANGUAGE: APIDOC
CODE:
```
| Global directives | CLI option | Description | Available in |
| :-----------------: | :-------------: | :------------------------------ | :-------------- |
| `title` | `--title` | Define title of the slide deck | HTML, PDF, PPTX |
| `description` | `--description` | Define description of the slide | HTML, PDF, PPTX |
| `author` | `--author` | Define author of the slide deck | HTML, PDF, PPTX |
| `keywords` | `--keywords` | Define comma-separated keywords | HTML, PDF |
| `url` | `--url` | Define [canonical URL] | HTML |
| `image` | `--og-image` | Define [Open Graph] image URL | HTML |
```
----------------------------------------
TITLE: Use Custom Theme with Marp CLI
DESCRIPTION: Explains how to apply a single custom CSS theme file to Marp CLI presentations by passing its path to the `--theme` option.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/README.md#_snippet_25
LANGUAGE: bash
CODE:
```
marp --theme custom-theme.css
```
----------------------------------------
TITLE: Marp CLI: Convert Markdown to PowerPoint (PPTX)
DESCRIPTION: This snippet demonstrates how to convert a Markdown slide deck into a PowerPoint document (PPTX). This conversion is enabled by passing the `--pptx` option or by specifying the output path with a `.pptx` extension.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/README.md#_snippet_8
LANGUAGE: bash
CODE:
```
marp --pptx slide-deck.md
marp slide-deck.md -o converted.pptx
```
----------------------------------------
TITLE: Marp CLI: Convert Markdown to PDF
DESCRIPTION: This snippet illustrates how to convert a Markdown slide deck into a PDF file. This can be achieved either by using the `--pdf` option or by specifying an output filename with a `.pdf` extension. Additional options like `--pdf-notes` for presenter notes and `--pdf-outlines` for PDF bookmarks (which can be configured for pages or headings) are also available.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/README.md#_snippet_7
LANGUAGE: bash
CODE:
```
marp --pdf slide-deck.md
marp slide-deck.md -o converted.pdf
```
----------------------------------------
TITLE: Use Built-in HTML Templates with Marp CLI
DESCRIPTION: This snippet demonstrates how to specify a built-in HTML template, such as 'bespoke', for a slide deck. The --template CLI option is used to apply the desired presentation style.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/README.md#_snippet_19
LANGUAGE: bash
CODE:
```
marp --template bespoke slide-deck.md
```
----------------------------------------
TITLE: Marp CLI Command Line Options Reference
DESCRIPTION: Detailed reference for command-line interface options available in Marp CLI, including their types, associated CLI flags, and a brief description of their functionality. Nested options are indicated by indentation.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/README.md#_snippet_38
LANGUAGE: APIDOC
CODE:
```
Option: parallel
Type: boolean | number
CLI Flag: --parallel -P
Description: Set the number of concurrency for parallel conversion (5 by default)
Option: pdf
Type: boolean
CLI Flag: --pdf
Description: Convert slide deck into PDF
Option: pdfNotes
Type: boolean
CLI Flag: --pdf-notes
Description: Add presenter notes to PDF as annotations
Option: pdfOutlines
Type: boolean | object
CLI Flag: --pdf-outlines
Description: Add outlines (bookmarks) to PDF
Properties:
Option: pages
Type: boolean
CLI Flag: --pdf-outlines.pages
Description: Make PDF outlines from slide pages (true by default when pdfOutlines is enabled)
Option: headings
Type: boolean
CLI Flag: --pdf-outlines.headings
Description: Make PDF outlines from Markdown headings (true by default when pdfOutlines is enabled)
Option: pptx
Type: boolean
CLI Flag: --pptx
Description: Convert slide deck into PowerPoint document
Option: pptxEditable
Type: boolean
CLI Flag: --pptx-editable
Description: [EXPERIMENTAL] Generate editable PPTX when converting to PPTX
Option: preview
Type: boolean
CLI Flag: --preview -p
Description: Open preview window
Option: server
Type: boolean
CLI Flag: --server -s
Description: Enable server mode
Option: template
Type: bare | bespoke
CLI Flag: --template
Description: Choose template (bespoke by default)
Option: theme
Type: string
CLI Flag: --theme
Description: Override theme by name or CSS file
Option: themeSet
Type: string | string[]
CLI Flag: --theme-set
Description: Path to additional theme CSS files
Option: title
Type: string
CLI Flag: --title
Description: Define title of the slide deck
Option: url
Type: string
CLI Flag: --url
Description: Define canonical URL
Option: watch
Type: boolean
CLI Flag: --watch -w
Description: Watch input markdowns for changes
```
----------------------------------------
TITLE: Programmatic Marp CLI Usage with marpCli() Function
DESCRIPTION: Shows how to use the `marpCli()` function from the `@marp-team/marp-cli` package to programmatically execute Marp CLI commands. It accepts CLI options as an array and returns a Promise that resolves with the exit status or rejects with an `Error`.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/README.md#_snippet_44
LANGUAGE: javascript
CODE:
```
const { marpCli } = require('@marp-team/marp-cli')
marpCli(['test.md', '--pdf'])
.then((exitStatus) => {
if (exitStatus > 0) {
console.error(`Failure (Exit status: ${exitStatus})`)
} else {
console.log('Success')
}
})
.catch(console.error)
```
----------------------------------------
TITLE: Access Built-in Marp Core Instance in Functional Engine
DESCRIPTION: Shows how to use the `marp` getter property, exposed to the functional engine's constructor options, to access and apply customizations like plugins to the built-in Marp Core engine instance.
SOURCE: https://github.com/marp-team/marp-cli/blob/main/README.md#_snippet_31
LANGUAGE: javascript
CODE:
```
const marpPlugin = require('marp-plugin-foo')
const andMorePlugin = require('marp-plugin-bar')
module.exports = ({ marp }) => marp.use(marpPlugin).use(andMorePlugin)
```
----------------------------------------
TITLE: Render Basic HTML Tags
DESCRIPTION: This snippet demonstrates the use of basic HTML tags: the tag for bold text and the