New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@cocy/transform-md

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cocy/transform-md

Uses [Remark](https://github.com/remarkjs/remark) to transform your Markdown content to HTML.

latest
Source
npmnpm
Version
1.0.0-alpha.2
Version published
Maintainers
1
Created
Source

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 HTML
  • frontmatter: parses YAML frontmatter
  • extract: adds frontmatter data to the vfile
  • assetResolver: custom plugin to resolve assets
  • 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). Can be disabled by setting config.generateExcerpt to false.

FAQs

Package last updated on 04 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts