How to use the @marp-team/marp-core/lib/browser.cjs 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-web / src / animation-frame.ts View on Github external
private loop() {
    // At first, clear the event queue for adding funcs to execute in next frame
    const events = this.animationEvents
    this.animationEvents = []

    // Execute registered events
    for (const func of events) func()

    // Finally trigger marp-core's fitting
    MarpBrowser(false)

    if (this.dispatched) this.requestAnimationFrame()
  }
github marp-team / marp-vscode / src / preview.ts View on Github external
if (marpVscode) {
    document.body.classList.add('marp-vscode')

    // Remove default styles
    const styles = document.querySelectorAll(
      'style:not(#marp-vscode-style):not(#_defaultStyles)'
    )
    const links = document.querySelectorAll(
      'link[rel="stylesheet"]:not([href*="marp-vscode"])'
    )
    styles.forEach(elm => elm.remove())
    links.forEach(elm => elm.remove())

    // Run Marp observer
    browserCjs()
  }
}

@marp-team/marp-core

The core of Marp tools

MIT
Latest version published 12 days ago

Package Health Score

71 / 100
Full package analysis