npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

remark-dl-list

v0.1.4

Published

A remark plugin that enables colon-based definition lists by wiring micromark and mdast extensions for <dl>, <dt>, and <dd>.

Readme

remark-dl-list

A remark plugin that enables colon-based definition lists using <dl>, <dt>, and <dd> syntax.

This plugin adds support for definition lists to remark and allows round-trip serialization back to markdown.

Syntax:

: term
    : description
    : another description

is converted to:

<dl>
  <dt>term</dt>
  <dd>description</dd>
  <dd>another description</dd>
</dl>

For the detailed definition list syntax, → docs/syntax.md.

Installation

npm install remark-dl-list

or with pnpm:

pnpm add remark-dl-list

Usage

Basic usage (Markdown ⇄ Markdown)

import { unified } from 'unified'
import remarkParse from 'remark-parse'
import remarkStringify from 'remark-stringify'
import remarkDlList from 'remark-dl-list'

const md = `
: term1
    : description1
    : description2

Still the same paragraph.
`

const file = await unified()
    .use(remarkParse)
    .use(remarkDlList)
    .use(remarkStringify)
    .process(md)

console.log(String(file))

Output:

: term1
    : description1
    : description2

Still the same paragraph.

HTML output

This plugin does not install remark-rehype automatically.

To generate HTML, combine it with remark-rehype and hast-util-dl-list:

import { unified } from 'unified'
import remarkParse from 'remark-parse'
import remarkRehype from 'remark-rehype'
import rehypeStringify from 'rehype-stringify'
import remarkDlList from 'remark-dl-list'
import { dlListHandlers } from 'hast-util-dl-list'

const html = await unified()
    .use(remarkParse)
    .use(remarkDlList)
    .use(remarkRehype, {
        handlers: dlListHandlers()
    })
    .use(rehypeStringify)
    .process(`
: term
    : description
  `)

console.log(String(html))

Using remark-dl-list with GFM (strikethrough)

When you use remark-dl-list together with other remark plugins (such as GFM), register those plugins before remark-dl-list so that definition list contents (dt / dd) can inherit their syntax during re-parsing.

Markdown → HTML example (with strikethrough)

import { unified } from 'unified'
import remarkParse from 'remark-parse'
import remarkGfm from 'remark-gfm'
import remarkRehype from 'remark-rehype'
import rehypeStringify from 'rehype-stringify'

import remarkDlList from 'remark-dl-list'
import { dlListHandlers } from 'hast-util-dl-list'

const processor = unified()
    .use(remarkParse)

    // Register other plugins FIRST (e.g. GFM)
    .use(remarkGfm)

    // Then register remark-dl-list
    .use(remarkDlList)

    // Convert mdast → hast
    .use(remarkRehype, {
        handlers: {
            ...dlListHandlers(),
        },
    })
    .use(rehypeStringify)

const md = `\
: fruits
    : **apple**
      _grape_
      ~~orange~~
`

const html = processor.processSync(md).toString()
console.log(html)

Output:

<dl>
  <dt>fruits</dt>
  <dd>
    <strong>apple</strong>
    <em>grape</em>
    <del>orange</del>
  </dd>
</dl>

Important notes

  • remark-dl-list re-parses the contents of dt and dd internally.
  • Therefore, any syntax extensions you want to use inside definition lists (such as GFM strikethrough) must already be registered when remark-dl-list runs.
  • Always place remark-dl-list after plugins like remark-gfm.

✔ Correct order remark-parse → remark-gfm → remark-dl-list → remark-rehype

What this plugin does

  • Adds colon-based definition list syntax to remark
  • Parses definition lists into mdast nodes
  • Supports multiple <dd> entries per <dt>
  • Supports block content inside <dd>
  • Supports round-trip serialization back to markdown

What this plugin does NOT do

  • Does not install remark-rehype
  • Does not generate HTML by itself
  • Does not change normal markdown behavior when no dl syntax is present

Related packages

This package is part of the unified-dl-list monorepo:

Related projects

  • markdown-it-dl-list A markdown-it plugin that provides the same colon-based definition list syntax.

License

MIT