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

@friedparrot/equation-citator

v1.3.7

Published

Web support for Equation Citator exported citations.

Readme

equation-citator-webnote

Introduction

Web citation grammar support for Equation Citator exported citations. Including web citations support for equations, figures and custom callouts.

This package is designed for pages that already contain Equation Citator exported citation spans:

<span class="equation-citator-citation" data-ec-kind="eq" data-ec-refs="[...]">...</span>

alt text

This package provides two entry points:

  • equation-citator/markdown-it: build-time target injection for Markdown-it.
  • equation-citator/runtime: browser hover previews, stable target IDs, and navigation.

Compatibility

You can use obsidian-equation-citator plugin to generate the citation HTML label with correct format. For the obsidian equation-citator plugin, see https://github.com/FRIEDparrot/obsidian-equation-citator.

Minor-version compatibility is applied. That means, equation-citator-webnote (npm package) v1.3.xx is compatible with obsidian-equation-citator v1.3.x.

Markdown-it

import equationCitatorMarkdownIt from 'equation-citator/markdown-it'

md.use(equationCitatorMarkdownIt, {
  include: (env) => env.relativePath?.startsWith('knowledge-base/'),
  enableObsidianCallouts: true
})

This injects target metadata for math blocks with \tag{...}, figures, and Equation Citator callout blockquotes.

Markdown repo path and image resolution

For Obsidian-style image embeds such as ![[img.png]], the markdown-it plugin needs to know which Markdown repository root contains the file being parsed. Markdown-it itself does not provide a stable final webpage URL during build, so pathMapping is required.

pathMapping maps each web repo link to the matching Markdown repo path, the format is :

pathMapping: [
  { webRoot: markdownSourceRoot }
]

where markdownSourceRoot is the root you used to render the markdown file, for example, the markdown file is

md.use(equationCitatorMarkdownIt, {
  pathMapping: [
    { 'your-website.com/knowledge-base': 'docs/knowledge-base' }
  ]
})
/// in that case, you call : 
const contentHtml = markdownIt.render(markdown, env); 
/*
 * if env.markdwonPath is 'docs/knowledge-base/../img.png' with relative path to knowledge-base, it will be resolved as `/knowledge-base/../image.png`
 */

When parsing docs/knowledge-base/Equation-Citator-Tutorial/Quick Start.md, the plugin selects the first mapping whose Markdown repo path matches the file path. Then ![[Equation-Citator-Tutorial/assets/Equation Citator Logo.png]] resolves to /knowledge-base/Equation-Citator-Tutorial/assets/Equation%20Citator%20Logo.png.

The plugin reads the parsed file path from env.markdownPath. If your build tool exposes another source path shape, set env.markdownPath before the plugin rule runs:

md.core.ruler.before('inline', 'repo-markdown-path', (state) => {
  state.env.markdownPath = `docs/${state.env.relativePath}`
})

Multiple mappings are supported. The first entry whose Markdown repo path matches the file being parsed is used.

For exported cross-file citations, the markdown-it plugin enriches each ref that has file with a resolved local URL inside data-ec-refs. The runtime uses this local URL for cross-file preview and navigation; it does not recompute file paths in the browser.

Heading section links

By default, Equation Citator does not rewrite Obsidian section links because different site builders may use different heading ID algorithms.

md.use(equationCitatorMarkdownIt, {
  useHeadingIdSlug: false
})

With useHeadingIdSlug: false, section targets such as [[#Heading]], [[Page#Heading]], ![[#Heading]], and ![[Page#Heading]] are left as their original wiki-link text.

Set useHeadingIdSlug: true only when you want Equation Citator to own the heading IDs for rendered Markdown:

md.use(equationCitatorMarkdownIt, {
  useHeadingIdSlug: true,
  pathMapping: [
    { '/knowledge-base': 'docs/knowledge-base' }
  ]
})

When enabled, the plugin injects IDs into rendered heading tokens without modifying Markdown source files. Existing heading IDs are preserved. Missing IDs are generated from heading text with buildHeadingId(), with duplicate IDs receiving -2, -3, and so on.

For repeated headings, the first generated ID keeps the base slug and later generated IDs are numbered in render order, however, they will not be slugged :

## Same Heading
## Same Heading
## Same Heading

renders with heading IDs equivalent to:

<h2 id="same-heading">Same Heading</h2>
<h2 id="same-heading-2">Same Heading</h2>
<h2 id="same-heading-3">Same Heading</h2>

Section links are then rendered against those IDs:

  • [[#Heading|label]] renders as a normal link to #heading.
  • [[Page#Heading|label]] renders as a normal link to the resolved page URL plus #heading.
  • ![[#Heading]] and ![[Page#Heading]] render as a jump link with text like Click here to jump to #Heading.

If another outline, sidebar, or heading plugin needs to use the same ID format, import the builder instead of copying the slug logic:

import { buildHeadingId } from 'equation-citator'

const id = buildHeadingId('My Heading')

Runtime

import { install } from 'equation-citator/runtime'

install({ router })

The runtime file should be copied into assets/runtime.js when building the docs because the generated docs pages need it in the browser.