1.0.0-alpha.2 • Published 5 years ago
@cocy/transform-md v1.0.0-alpha.2
Cocy Transform Markdown
Uses Remark to transform your Markdown content to HTML.
Usage
import md from '@cocy/transform-md';
cocy.use(md, options?);Options
See here.
Frontmatter assets
You can load assets in frontmatter by using the assets key:
---
title: Hello!
assets:
thumb: ./my-photo.jpg
---On the CocyFile object, you can retrieve the asset using file.assets.get('thumb'). Read more about assets with Cocy here. Inline image assets (![]()) work as well.
Built-in Remark plugins
By default, the following plugins are loaded, which you can modify using hooks as shown above:
html: transforms Markdown to HTMLfrontmatter: parses YAML frontmatterextract: adds frontmatter data to the vfileassetResolver: custom plugin to resolve assetsexcerptGenerator: also custom, adds an excerpt to the result's attributes, which is either the frontmatter value ofexcerpt, all paragraphs before a<!-- more -->tag or the first paragraph of text (in that order). Can be disabled by settingconfig.generateExcerpttofalse.
1.0.0-alpha.2
5 years ago
1.0.0-alpha.1
5 years ago