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

pugneum-mixins

v2.0.0

Published

Reusable mixin library for pugneum templates

Readme

pugneum-mixins

Reusable mixin library for pugneum templates.

Installation

npm install pugneum-mixins

Quotation

+quote(source?)

Figure-wrapped quotation. The optional source URL is used only for the blockquote cite= attribute. A supplied block caption becomes the figcaption; without it, the caption is omitted.

include @pugneum-mixins/quote.pg

+quote(https://example.com/quotation)
  | Quoted text here.
  block caption
    +linked-citation(https://example.com/work)
      block attribution
        | Example Author
      block title
        | Example Work
<figure>
  <blockquote cite="https://example.com/quotation">Quoted text here.</blockquote>
  <figcaption>Example Author, <cite><a href="https://example.com/work">Example Work</a></cite></figcaption>
</figure>

+citation(separator?), +linked-citation(href separator?)

Structured citation fragments for use in a quote caption or any other phrasing content. Both accept rich attribution and title slots. Only the title is wrapped in <cite>; the linked form additionally wraps that title in an anchor. The separator defaults to ", " and appears only when both slots are supplied.

include @pugneum-mixins/quote.pg

+quote
  | An anonymous quote.
  block caption
    +citation(' — ')
      block attribution
        | Anonymous
      block title
        | Oral tradition

The linked helper's href is required by its public contract. Attribution-only and title-only citations are valid and do not emit dangling punctuation or empty semantic wrappers.

Figure

+figure

General-purpose figure wrapper with optional caption.

include @pugneum-mixins/figure.pg

+figure
  img(src="photo.jpg" alt="A sunset")
  block caption
    | A sunset over the mountains.

+code

Code block wrapped in a figure with optional caption.

include @pugneum-mixins/code.pg

+code
  :prismjs(language=javascript)
    console.log('hello');
  block caption
    | A minimal program.

The Prism filter is a separate optional package. Install it alongside the mixin library before using this example:

npm install pugneum-mixins pugneum-filter-prismjs

Disclosure

+details(summary?)

Disclosure widget. A scalar summary is the simple fallback. A rich block summary may be supplied instead and takes precedence when both exist.

include @pugneum-mixins/details.pg

+details('System Requirements')
  p Requires a computer with memory.

+details
  block summary
    | Frequently Asked *(Questions)
  p Rich phrasing is allowed in the summary.

Navigation

Breadcrumb helpers

+breadcrumbs(label?) creates an aria-label landmark and defaults to "Breadcrumb". +breadcrumbs-labelledby(id) instead references an authored accessible name. +breadcrumb-current renders an honest non-link span; +breadcrumb-current-link(href) is the explicit self-link form.

include @pugneum-mixins/breadcrumb.pg

+breadcrumbs('Fil d Ariane')
  +breadcrumb(/) Home
  +breadcrumb(/articles) Articles
  +breadcrumb-current-link(/articles/current) Current article

File System

+file-system, +file(name), +directory(name)

File tree visualization. A file's unnamed body is rendered immediately after its <code> name and can be used for an annotation. Directories instead use an optional block description annotation; their unnamed body contains child entries.

+file-system takes an optional CSS class. Multiple classes must be quoted, since an unquoted argument list splits on whitespace: write +file-system('tree wide'), not +file-system(tree wide).

include @pugneum-mixins/file-system.pg

+file-system
  +directory(src)
    block description
      |  — source code
    +file(index.js)
      |  — entry point
    +file(render.js)

Notes

These mixins follow pugneum's core model: the template author is the HTML author. A few consequences are worth calling out.

Text arguments and slot text are emitted raw. The name in +file/+directory, a scalar summary in +details, the code fed to +code, and any text in breadcrumb, quote, or citation slots are written to the output verbatim — <, > and & are not escaped. (Attribute values such as href/cite/class are escaped.) If a value may contain HTML metacharacters or is not fully trusted, pre-escape it or pass it through an escaping filter (+code content is typically produced by :prismjs/:highlight.js, which escape). Do not feed untrusted data straight into these text positions.

Multi-word arguments must be quoted. An unquoted argument list splits on whitespace, so +details(System Requirements) and +file-system(tree wide) raise PUGNEUM:MIXIN_ARGUMENT_COUNT_MISMATCH. Quote them: +details('System Requirements'), +file-system('tree wide').

Core trailing arguments can be omitted. Pugneum permits callers to omit trailing mixin arguments even when their declaration has no ? or default. The helper contracts remain stricter: supply the href required by +breadcrumb, +breadcrumb-current-link, and +linked-citation. A missing required href would otherwise produce an href-less anchor. The source for +quote and scalar summary for +details are explicitly optional.

License

MIT