How to use the remark.stringify 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 transloadit / uppy / website / build-documentation.js View on Github external
documentationFormatter(comments, {}, function (err, output) {
    if (err) {
      throw new Error(err)
    }

    var inputMarkdownContent = remark.parse(fs.readFileSync('src/api/docs.md', 'utf-8'))
    var newStuff = remark.parse(output)
    inject('Uppy Core & Plugins', inputMarkdownContent, newStuff)

    fs.writeFileSync('src/api/docs.md', remark.stringify(inputMarkdownContent))
    console.info(chalk.green('✓ documentation generated'))
  })
})
github mrzmmr / remark-behead / src / index.js View on Github external
* Manipulates hading nodes between but not including the two given 
       * strings, starting with options.between[0] and ending with
       * options.between[1].
       *
       * @name options.between
       *
       * @example
       * remark(behead, {weight: 1, between: ['# Hello', '# World']})
       *   .process('# Hello\n# Between\n# World')
       *
       *   => '# Hello\n## Between\n# World\n'
       */
      if (opts.between) {
        if (switched) {

          if (remark.stringify(node) === opts.between[1]) {
            switched = false
            return node
          }

          return behead(node, opts)
        }

        if (remark.stringify(node) === opts.between[0]) {
          switched = true
          return node
        }

        return node
      }
    })

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