How to use the remark.use function in remark

To help you get started, we’ve selected a few remark 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 thangngoc89 / blog / old / web_modules / utils / statinamic-agolia-plugin.js View on Github external
const sendToAgolia = (opts) => {
  const when = opts.when
  if (typeof when === "function" && !when()) {
    return
  }
  const mdProcess = remark.use(strip)
  // Flatten head
  let data = cache.map((item) => {
    return {
      ...item,
      ...item.head,
      head: undefined,
    }
  })

  if (opts.collectionOptions) {
    data = enhanceCollection(data, opts.collectionOptions)
  }

  data = data.map((item) => {
    item.objectID = item.__filename
    item.body = mdProcess.process(item.rawBody)

remark

markdown processor powered by plugins part of the unified collective

MIT
Latest version published 1 year ago

Package Health Score

79 / 100
Full package analysis