Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

remark-deflist

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remark-deflist

Remark plugin for pandoc-style definition lists.

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
6.2K
-18%
Maintainers
1
Weekly downloads
 
Created
Source

remark-deflist

CI/CD Status MIT License stars

Remark plugin for adding support for pandoc-style definition lists to Markdown.

Adds three new node types to MDAST: descriptionlist, descriptionterm, and descriptiondetails. When using rehype, these will be stringified as dl, dt, and dd respectively.

Mostly compatible with the pandoc/PHP Markdown Extra syntax. The only difference is that multi-paragraph descriptions are not currently supported.

Install

This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required.

npm:

npm install remark-deflist

Example

Syntax

Term 1

: Definition 1

AST

The example above will yield:

{
  type: 'descriptionlist',
  children: [
    {
      type: 'descriptionterm',
      children: [{
        type: 'text',
        value: 'Term 1'
      }]
    },
    {
      type: 'descriptiondetails',
      children: [{
        type: 'text',
        value: 'Definition 1'
      }]
    }
  ]
}

Syntax

Term with *inline markup*

: Definition **1**
Lazy Initialization
: Achievement of compactness by not typing an extra line after the definition term.
Continuation

:   Splitting a single paragraph
    across multiple lines.
Lazy Continuation
: Ugliness
by not indenting text.
This is an example of multiple definitions for a single term.

Indent
: (*noun*) A whitespace to align text in a beautiful way.
: (*verb*) To add whitespace to make ugly code beautiful.

Usage

import { unified } from 'unified'
import markdown from 'remark-parse'
import html from 'rehype-stringify'
import remark2rehype from 'remark-rehype'
import meta from 'remark-meta'

unified()
  .use(markdown)
  .use(meta)
  .use(remark2rehype)
  .use(html)

License

MIT © Alex Shaw

Keywords

remark

FAQs

Package last updated on 20 Aug 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