How to use the @marp-team/marp-core.Marp function in @marp-team/marp-core

To help you get started, we’ve selected a few @marp-team/marp-core 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-vscode / src / extension.ts View on Github external
md.parse = (markdown: string, env: any) => {
    // Generate tokens by Marp if enabled
    if (detectMarpFromMarkdown(markdown)) {
      const mdFolder = Uri.parse(md.normalizeLink('.')).with({ scheme: 'file' })
      const workspaceFolder = workspace.getWorkspaceFolder(mdFolder)
      const baseFolder = workspaceFolder ? workspaceFolder.uri : mdFolder

      const marp = new Marp(marpCoreOptionForPreview(md.options))
        .use(customTheme)
        .use(outline)
        .use(lineNumber)

      // Load custom themes
      let shouldRefresh = false

      Promise.all(
        themes.loadStyles(baseFolder).map(promise =>
          promise
            .then(theme => {
              if (theme.registered) shouldRefresh = true
            })
            .catch(e => console.error(e))
        )
      ).then(() => {
github tyrchen / tongjian / tools / cli / engine.js View on Github external
module.exports = opts => {
  return new Marp(opts)
    .use(markdownItMark)
    // .use(markdownItFootnote)
    .use(markdownItAbbr)
    .use(markdownItSup)
    .use(markdownItSub)
    .use(markdownItEmoji)
    .use(html5Media)
    .use(markdownItContainer, 'note');

}
github marp-team / marp / packages / website / src / components / marp.js.jsx View on Github external
export const Marp = props => {
  const marp = new MarpCore({
    container: null,
    script: false,
    printable: false,
  })

  marp.markdown.normalizeLink = url => resolvePath(url)

  const rendered = marp.render(props.markdown, { htmlAsArray: true })

  return (
    <div>
      </div>

@marp-team/marp-core

The core of Marp tools

MIT
Latest version published 2 months ago

Package Health Score

79 / 100
Full package analysis