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

comark-wikilink

v0.1.1

Published

Wikilink syntax plugin for Comark.

Readme

comark-wikilink

Wikilink syntax plugin for Comark.

This plugin adds support for [[target]] and [[target|label]] wikilink syntax to Markdown.

It supports two rendering modes:

  • a mode (Default) — Parses wikilinks into standard link (a) nodes, producing the same AST output as standard markdown link syntax [label](target).
  • component mode — Parses wikilinks into custom wikilink nodes, allowing you to control how links are resolved and rendered via a custom component.

Installation

npm install comark-wikilink comark

a mode

wikilink({ mode: "a" });

Wikilinks are parsed into the same a nodes as regular Markdown links. They can be rendered and customized through the same pipeline as other links, without any wikilink-specific handling.

Configuration

{
  mode: "a";
  resolveHref?: (target: string) => string | null;
  resolveLabel?: (target: string) => string | null;
}

| Option | Default | Description | | :------------- | :------ | :------------------------------------------------------------------------------------------------------------------------------------- | | resolveHref | null | A function that transforms a wikilink target into the href used by the generated <a> element. If null, the target is used as-is. | | resolveLabel | null | A function that resolves the label displayed for wikilinks that do not specify an explicit label. If null, the target is used as-is. |

component mode

wikilink({ mode: "component" });

In component mode, wikilinks are parsed into custom wikilink nodes, allowing them to be handled separately from regular links. Unlike a mode, component mode preserves whether a label was explicitly specified.

Use mode: "component" when wikilinks need to be handled differently from regular links.

AST Output

For example:

[[getting-started]]
[[getting-started|Getting started]]

The resulting AST nodes are:

["wikilink", { "target": "getting-started" }]
["wikilink", { "target": "getting-started", "label": "Getting started" }]

The wikilink node has no children, so a wikilink component must be provided by the renderer.

Example

import { Markdown } from "@comark/react";
import wikilink from "comark-wikilink";

interface WikiLinkProps {
  target: string;
  label?: string;
}

function WikiLink({ target, label }: WikiLinkProps) {
  const page = getPage(target);

  if (!page) {
    return <span>{label ?? target}</span>;
  }

  return <a href={`/wiki/${page.slug}`}>{label ?? page.title}</a>;
}

export default function App() {
  return (
    <Markdown plugins={[wikilink({ mode: "component" })]} components={{ wikilink: WikiLink }}>
      {content}
    </Markdown>
  );
}

Configuration

{
  mode: "component";
}

License

MIT