@nkduy/markdown

1.5.1 • Public • Published

@nkduy/markdown

markdown library for KduPress

Public API

PLUGINS

A map constant containing the names of all built-in markdown-it plugins.

isRequiredPlugin(pluginName: string)

  • Usage:
const { isRequiredPlugin } = require('@nkduy/markdown')
console.log(isRequiredPlugin(PLUGINS.COMPONENT)) // true
console.log(isRequiredPlugin(PLUGINS.HIGHLIGHT_LINES)) // false

removePlugin(config: chainMarkdown, pluginName: string)

Remove the specified built-in markdown-it plugin in KduPress.

  • Usage:
// Your KduPress Plugin or site config.
const { removePlugin } = require('@nkduy/markdown')
module.exports = {
  chainMarkdown (config) {
    removePlugin(config, PLUGINS.HIGHLIGHT_LINES)
  }
}

Note that PLUGINS.COMPONENT and PLUGINS.ANCHOR are required in KduPress, It is forbidden to delete them!

removeAllBuiltInPlugins(config: chainMarkdown)

Remove all built-in but not 100% necessary markdown-it plugins in KduPress.

  • Usage:
// Your KduPress Plugin or site config.
module.exports = {
  chainMarkdown (config) {
    require('@nkduy/markdown').removeAllBuiltInPlugins(config)
  }
}

Package Sidebar

Install

npm i @nkduy/markdown

Weekly Downloads

1

Version

1.5.1

License

MIT

Unpacked Size

21.1 kB

Total Files

12

Last publish

Collaborators

  • nkduy