npm.io
2.0.0-alpha.0 • Published 5 years ago

contently-transform-markdown

Licence
MIT
Version
2.0.0-alpha.0
Deps
10
Size
12 kB
Vulns
0
Weekly
0

Contently Transform Markdown

Uses Remark to transform your Markdown content.

Usage

import ContentlyTransformMarkdown from 'contently-transform-markdown';

contently.use(ContentlyTransformMarkdown, options?);

Options

interface Options {
	/**
	 * @name plugins
	 * @description An array of Remark plugins.
	 * @default 'html,frontmatter,extract-frontmatter'
	 */
	plugins: Array<{ plugin: any; options?: any }>;
}

Asset resolving

TODO: explain it

Built-in Remark plugins

By default, the following plugins are loaded, which you can modify using hooks as shown above:

  • html: transforms Markdown to HTML
  • frontmatter: parses YAML frontmatter
  • extract: adds frontmatter data to the vfile
  • assetResolver: custom plugin, allows you to hook into asset loading (see above)
  • excerptGenerator: also custom, adds an excerpt to the result's attributes, which is either the frontmatter value of excerpt, all paragraphs before a <!-- more --> tag or the first paragraph of text (in that order).