Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

micromark-extension-directive

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

micromark-extension-directive

micromark extension to support generic directives (`:cite[smith04]`)

  • 3.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
449K
increased by6.31%
Maintainers
1
Weekly downloads
 
Created

What is micromark-extension-directive?

The micromark-extension-directive package is an extension for micromark, a Markdown parser, that allows for the use of custom directives within Markdown content. This can be useful for adding custom syntax or functionality to Markdown documents.

What are micromark-extension-directive's main functionalities?

Custom Block Directives

This feature allows you to define custom block directives in your Markdown content. The example shows how to use a custom block directive and convert it to HTML using micromark.

const micromark = require('micromark');
const directive = require('micromark-extension-directive');

const content = ':::{custom-block}
This is a custom block directive.
:::';

const html = micromark(content, {
  extensions: [directive()]
});

console.log(html);

Custom Leaf Directives

This feature allows you to define custom leaf directives in your Markdown content. The example shows how to use a custom leaf directive and convert it to HTML using micromark.

const micromark = require('micromark');
const directive = require('micromark-extension-directive');

const content = '::custom-leaf[This is a custom leaf directive.]';

const html = micromark(content, {
  extensions: [directive()]
});

console.log(html);

Custom Text Directives

This feature allows you to define custom text directives in your Markdown content. The example shows how to use a custom text directive and convert it to HTML using micromark.

const micromark = require('micromark');
const directive = require('micromark-extension-directive');

const content = 'This is a text with a ::custom-text[custom text directive].';

const html = micromark(content, {
  extensions: [directive()]
});

console.log(html);

Other packages similar to micromark-extension-directive

Keywords

FAQs

Package last updated on 19 Sep 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc