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

better-markdown

v1.0.0

Published

Extended markdown-it plugins for Obsidian-style wikilinks, checkboxes, callouts, and more

Readme

Better Markdown

Extended markdown-it plugins for Obsidian-style wikilinks, interactive checkboxes, callouts, footnotes, and more.

npm version License: MIT

Features

  • 🔗 Wikilinks - Obsidian-style [[note]] linking with heading and block support
  • Interactive Checkboxes - [ ], [x], [-] with click-to-toggle
  • 📻 Radio Buttons - ( ) and (x) for single-choice options
  • 📢 Callouts - Beautiful alert boxes (:warning: text :)
  • 📝 Footnotes - Auto-numbered references [^1]
  • 🎨 Custom Syntax - Simplified formatting (/italic/, *bold*, =highlight=, etc.)
  • 🔖 Block IDs - Direct linking to paragraphs ^block-id
  • 🎭 And more - Toggles, buttons, auto-linking for emails/phones/hashtags

Installation

npm install better-markdown markdown-it

Quick Start

import MarkdownIt from 'markdown-it';
import { applyAllPlugins } from 'better-markdown';

const md = new MarkdownIt();
applyAllPlugins(md);

const html = md.render('[[My Note]] with a [[wikilink]]!');

Individual Plugin Usage

Import only the plugins you need:

import MarkdownIt from 'markdown-it';
import { markdownWikilinks, markdownCheckboxes } from 'better-markdown';

const md = new MarkdownIt();
md.use(markdownWikilinks);
md.use(markdownCheckboxes);

Available Plugins

Wikilinks

Obsidian-style note linking:

[[Note Name]]                    # Basic wikilink
[[Note#Heading]]                 # Link to heading
[[Note^block-id]]                # Link to block
[[Long Note Name|Display Text]]  # Custom display

Rendering: Creates <a class="wikilink"> with data attributes (data-target, data-heading, data-block)

Checkboxes

Interactive task lists:

[ ] Unchecked task
[x] Completed task
[-] Indeterminate/in-progress

Radio Buttons

Single-choice lists:

( ) Option A
(x) Option B (selected)
( ) Option C

Callouts

Color-coded alert boxes:

(:warning: This is important :)
(:info: Helpful information :)
(:question: Why does this happen? :)
(:custom-color: Custom styled :)

Footnotes

Auto-numbered references:

This is a citation[^1].

[*1] Footnote definition appears at bottom

Custom Syntax

Simplified text formatting:

*bold* or ** bold text **
/italic/ or // italic text //
_underline_ or __ underline text __
=highlight= or == highlight text ==
-strike- or -- strike text --
^superscript^
~subscript~

Block IDs

Direct paragraph linking:

This paragraph has an ID. ^my-block

Link to it: [[#^my-block]]

Integration Examples

CodeMirror 6

import { EditorView } from '@codemirror/view';
import { markdown } from '@codemirror/lang-markdown';
import MarkdownIt from 'markdown-it';
import { applyAllPlugins } from 'better-markdown';

const md = new MarkdownIt();
applyAllPlugins(md);

new EditorView({
  extensions: [
    markdown({
      base: markdownLanguage,
      codeLanguages: languages
    })
  ],
  parent: document.body
});

// Render preview
const html = md.render(editorContent);

React

import { useState } from 'react';
import MarkdownIt from 'markdown-it';
import { applyAllPlugins } from 'better-markdown';

const md = new MarkdownIt();
applyAllPlugins(md);

function MarkdownEditor() {
  const [text, setText] = useState('');
  
  return (
    <div>
      <textarea value={text} onChange={e => setText(e.target.value)} />
      <div dangerouslySetInnerHTML={{ __html: md.render(text) }} />
    </div>
  );
}

Handling Wikilink Clicks

document.addEventListener('click', (e) => {
  if (e.target.classList.contains('wikilink')) {
    e.preventDefault();
    const target = e.target.dataset.target;
    const heading = e.target.dataset.heading;
    const blockId = e.target.dataset.block;
    
    // Implement your navigation logic
    navigateToNote(target, heading, blockId);
  }
});

Utility Functions

import { wikilinkUtils } from 'better-markdown';

// Extract all wikilinks from text
const links = wikilinkUtils.extractWikilinks(markdown);
// Returns: [{ target, heading, blockId, display, raw }]

// Extract all block IDs
const blockIds = wikilinkUtils.extractBlockIds(markdown);
// Returns: ['block-1', 'block-2', ...]

// Generate unique block ID
const id = wikilinkUtils.generateBlockId();
// Returns: 'block-abc123xyz'

API Reference

applyAllPlugins(md)

Convenience function that applies all plugins to a markdown-it instance.

Parameters:

  • md (MarkdownIt): The markdown-it instance

Returns: The same markdown-it instance with all plugins applied

Individual Plugins

All plugins follow the standard markdown-it plugin signature:

function plugin(md, options) { ... }
  • customSyntaxPlugin - Custom text formatting
  • markdownCheckboxes - Interactive checkboxes
  • markdownRadios - Radio button lists
  • markdownCallouts - Alert boxes
  • markdownToggles - Collapsible lists
  • markdownWikilinks - Note linking
  • markdownBlockIds - Block identifiers

Styling

Better-markdown generates semantic HTML with appropriate classes. You'll need to add CSS for styling. See the demo app for example styles.

Example CSS for wikilinks:

.wikilink {
  color: #7c3aed;
  background-color: rgba(124, 58, 237, 0.08);
  padding: 0.1em 0.3em;
  border-radius: 3px;
  text-decoration: none;
}

Browser Compatibility

Works in all modern browsers and Node.js environments that support ES6+.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT © Better Markdown Contributors

Roadmap

  • [ ] TypeScript definitions
  • [ ] React hooks package
  • [ ] CSS stylesheet package
  • [ ] Interactive playground
  • [ ] Comprehensive test suite