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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@anywhichway/autohelm

v0.0.35

Published

A library to support standardized table of contents and footnote navigation in HTML files

Downloads

3

Readme

autohelm

A library to support standardized table of contents and footnote navigation in HTML files.

Early version of documentation ...

Usage

npm install --save @anywhichwya autohelm

Add a heading in your HTML file with the class "autohelm-toc" at the location you want the TOC.

<h1>Introduction</h1>
Some intro text

<h1 class="autohelm-toc">Table of Contents</h1>

<h1>Section One</h1>

Some content with a footnote.<span class="autohelm-footnote">a footnote</span>

<h1>Section Two</h1>

Add JavaScript something like this:

import {buildFootnotes,buildTOC,engage} from "autohelm";

document.addEventListener((DOMContentLoaded) => {
    buildFootnotes(); // if your doc has footnotes, i.e. elements with the class autohelm-footnote (usually spans)
    buildTOC();
    engage();
})

Styling

These are the suggested styles to add to you stylesheet

span.autohelm-nav a {text-decoration: unset; color:unset}
span.autohelm-nav-up-down a {font-size: 80%; vertical-align:text-top}
span.autohelm-footnote {position:relative; font-size:small; top:-.5em}

See the site https://secst.org for an example of heavy use of Autohelm.

History (Reverse Chronological Order)

2022-12-22 v0.0.35 Corrected history dates, they were set to 2023. Added styling info to README.

2022-12-17 v0.0.34 Remove TOC from the TOC itself.

2022-12-17 v0.0.33 Fixed issue with previous and next arrows navigating to wrong place.

2022-12-17 v0.0.32 Further improvements to section heading selection.

2022-12-17 v0.0.31 Improved useSections to only select headers that are the first child of a section.

2022-12-16 v0.0.30 Removed some secondary heading filtering.

2022-12-16 v0.0.29 Added option 'useSections' which will only use headings that are the first child of a section element.

2022-12-08 v0.0.28 Added option 'directChildren' to init in addition the buildTOC.

2022-12-08 v0.0.27 Added option 'directChildren' to restrict headings to only those that are direct children of the node being searched for headings.

2022-12-04 v0.0.25 Reduce size of open/close caret

2022-12-04 v0.0.24 First documented public version