How to use the documentation.util.createFormatters function in documentation

To help you get started, we’ve selected a few documentation 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 dignifiedquire / clean-documentation-theme / src / utils.js View on Github external
'use strict'

const GithubSlugger = require('github-slugger')
const hljs = require('highlight.js')
const util = require('documentation').util
const createFormatters = util.createFormatters
const LinkerStack = util.LinkerStack
const _ = require('lodash')

module.exports = class Utils {
  constructor (options, comments) {
    this.linkerStack = new LinkerStack(options)
      .namespaceResolver(comments, (namespace) => {
        const slugger = new GithubSlugger()
        return '#' + slugger.slug(namespace)
      })

    this.options = options
    this.comments = comments
    this.formatters = createFormatters(this.linkerStack.link)
    this.options.hljs = this.options.hljs || {}