2.0.0-alpha.0 • Published 3 years ago

contently-transform-markdown v2.0.0-alpha.0

Weekly downloads
4
License
MIT
Repository
github
Last release
3 years ago

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).