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

prettier-plugin-pandoc

v0.1.2

Published

A Prettier plugin for Pandoc Markdown and Quarto documents

Readme

prettier-plugin-pandoc

A Prettier plugin for formatting Pandoc Markdown (.md) and Quarto documents (.qmd).

CI npm

[!WARNING] This plugin is currently in early development. It has been verified against a comprehensive suite of syntax test cases, but has not yet been battle-tested on a large number of real-world projects. Please use with caution and backup your data (e.g. via git) before formatting.

Features

Dual Parser Support

This plugin includes two parsers to handle the subtle differences between standard Pandoc Markdown and Quarto's extended syntax:

  • pandoc parser - Standard Pandoc for .md files

    • ✅ Citations: [@smith2020]
    • ✅ Definition lists
    • ✅ Divs/Callouts: ::: {.note}
    • ✅ GFM (tables, task lists, etc.)
    • ✅ Math blocks (standard)
  • quarto parser - Extended support for .qmd files

    • Everything in Pandoc parser
    • ✅ Math blocks with labels: $$ E=mc^2 $$ {#eq-einstein}
    • ✅ Shortcodes: {{< meta title >}}

Safety Features

  • Code block protection - Content inside fenced code blocks is never modified
  • Lossless round-trips - Formatting preserves all attributes and metadata
  • Tested - Comprehensive automated test suite ensuring semantic equivalence

Installation

npm install --save-dev prettier prettier-plugin-pandoc

Usage

Automatic Configuration

Prettier automatically uses the quarto parser for .qmd files.

For .md files, Prettier defaults to its built-in Markdown parser. You must explicitly configure it to use the pandoc parser if you want to support Pandoc features like citation syntax or definition lists.

.prettierrc

{
  "plugins": ["prettier-plugin-pandoc"],
  "overrides": [
    {
      "files": "*.md",
      "options": {
        "parser": "pandoc"
      }
    }
  ]
}

Running Prettier

Format all documents:

npx prettier --write "**/*.{md,qmd}"

Examples

Pandoc Markdown (.md)

Input:

# Citations

See @smith2020 for details.

Term
:   Definition

Output: (formatted, standard Pandoc syntax preserved)

Quarto Document (.qmd)

Input:

---
title: My Analysis
---

# Introduction

Black-Scholes (@eq-bs) is elegant:

$$
\frac{\partial C}{\partial t} + \frac{1}{2}\sigma^2 S^2 \frac{\partial^2 C}{\partial S^2} = rC
$$ {#eq-bs}

{{< meta title >}} uses R.

Output: (formatted, preserves all Quarto specific syntax)

Compatibility

  • Prettier: ^3.0.0
  • Node.js: >=18.0.0 (ES modules)
  • Browser: Bundled version available (55KB gzipped)
  • Pandoc: Tested with Pandoc 3.1+
  • Quarto: Tested with Quarto 1.4+

Browser Usage

A pre-bundled version is available for browser applications:

import * as prettier from 'prettier/standalone'
import pandocPlugin from 'prettier-plugin-pandoc/browser'

const formatted = await prettier.format(markdown, {
  parser: 'pandoc',
  plugins: [pandocPlugin],
})

Development

# Install dependencies
npm install

# Build
npm run build

# Test
npm test

Contributing

Contributions welcome! Please:

  1. Open an issue first to discuss changes
  2. Follow existing code style
  3. Add tests for new features
  4. Update README for user-facing changes

License

MIT

Credits

Built with: