How to use @marp-team/marpit - 3 common examples

To help you get started, we’ve selected a few @marp-team/marpit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github marp-team / marp-cli / test / templates / bespoke.ts View on Github external
describe("Bespoke template's browser context", () => {
  const marp = new Marp({
    container: new MarpitElement('div', { id: 'p' }),
  })

  const defaultMarkdown = '# 1\n\n---\n\n## 2\n\n---\n\n### 3'

  const render = (
    md = defaultMarkdown,
    targetDocument = document
  ): HTMLElement => {
    targetDocument.body.innerHTML = marp.render(md).html
    return targetDocument.getElementById('p')!
  }

  const replaceLocation = >(
    path: string,
    action: () => T
  ): T => {
github marp-team / marp-cli / src / templates / index.ts View on Github external
export const bespoke: Template = async opts => {
  const rendered = opts.renderer({
    container: new Element('div', { id: 'p' }),
    inlineSVG: true,
    slideContainer: [],
  })

  return {
    rendered,
    result: bespokePug({
      ...opts,
      ...rendered,
      bespoke: {
        css: bespokeScss,
        js: await libJs('bespoke.js'),
        osc: opts.osc ?? true,
        progress: opts.progress,
      },
      watchJs: await watchJs(opts.notifyWS),
github marp-team / marp-cli / src / templates / index.ts View on Github external
export const bespoke: Template = async opts => {
  const rendered = opts.renderer({
    container: new Element('article', { id: 'presentation' }),
    inlineSVG: true,
    slideContainer: [],
  })

  return {
    rendered,
    result: bespokePug({
      ...opts,
      ...rendered,
      progress: false,
      bespoke: {
        css: bespokeScss,
        js: await bespokeJs(),
      },
    }),
  }

@marp-team/marpit

The skinny framework for creating slide deck from Markdown

MIT
Latest version published 7 months ago

Package Health Score

67 / 100
Full package analysis

Popular @marp-team/marpit functions