// marp.config.mjs
import { defineConfig } from "@marp-team/marp-cli";
import Shiki from "@shikijs/markdown-it";
export default defineConfig({
engine: async ({ marp }) => {
marp.use(await Shiki({ theme: "nord" }));
return marp;
},
});
{N,M-K})Write line numbers like {2,4-5} after the language tag in a fence to apply the .highlighted class to those lines (transformerMetaHighlight).
const a = 1;
const b = 2; // this line is highlighted
const c = 3;
const d = 4; // from here
const e = 5; // ...to here
/word/)Write a word like /sayHello/ after the language tag in a fence to wrap every occurrence in .highlighted-word (transformerMetaWordHighlight).
const sayHello = (name) => {
console.log(`Hello ${name}`);
};
sayHello("John");
[!code focus])Add a // [!code focus] comment in the code to mark that line with .focused; the rest of the lines are dimmed via the .has-focused decoration (opacity + blur). (transformerNotationFocus)
const a = 1;
const b = 2;
const c = a + b;
console.log(c);
// marp.config.mjs
import { defineConfig } from "@marp-team/marp-cli";
import MarkdownItGitHubAlerts from "markdown-it-github-alerts";
export default defineConfig({
engine: async ({ marp }) => {
marp.use(MarkdownItGitHubAlerts);
return marp;
},
});
Note
Highlights information that users should take into account, even when skimming.
Tip
Optional information to help a user be more successful.
Important
Crucial information necessary for users to succeed.
Warning
Critical content demanding immediate user attention due to potential risks.
Caution
Negative potential consequences of an action.