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

h5o

v0.11.3

Published

HTML5 outliner

Downloads

3,436

Readme

HTML5 outliner

Build Status Supported: io.js Supported: node v0.10 Supported: node v0.12

Supported: phantom.js v1.9 Supported: jsdom v3.x Supported: jsdom v4.x

Sauce Test Status

h5o is an implementation of the HTML5 outline algorithm in JavaScript. Specifications:

If you like this tool, please consider a charitable donation to Ocean Voyages Institute (Project Kaisei).

Usage

npm install h5o (as of 2015, you should not be using any other way of managing your JS dependencies, but you can still download latest release)

  • Use the UMD module available in dist/outliner.min.js with a fallback to global HTML5Outline or var HTML5Outline = require('h5o') in node or browserify
  • var outline = HTML5Outline(startFrom) (you likely want startFrom to be document.body). Returned value is an outline object, with sections.
  • outline.asHTML( [ options | createLinks ]) to get HTML with an ordered list.
    • If options.createLinks (or createLinks) is true, the DOM will be amended with IDs and the list will contain links for navigation.
    • If options.skipToHeader is true, the outline HTML will only include the sub-sections of the first section in the outline (which is usually the body), i.e. it will only contain the sections of the documents, skipping the title of the whole document.

Visit https://h5o.github.io/ for the Chrome extension and bookmarklet.

Development

Pre-requisites

  1. install node or iojs (includes npm)
  2. npm install -g grunt-cli
  3. npm install in your local clone of this repo

Run tests locally

Run grunt test

Run grunt watch

  • Will watch for file changes and rebuild/run tests automatically

History

vNext (????-??-??)

  • ???

v0.11.3 (2015-08-05)

v0.11.0 (2015-04-10)

  • Split off bookmarklet into a separate repo: https://github.com/h5o/h5o-bookmarklet

v0.10.4-v0.10.6 (2015-03-29)

  • Bookmarklet no longer part of GH releases
  • Some styling for bookmarklet.html

v0.10.1-v0.10.3 (2015-03-25)

  • Auto-publish in npm via Travis

v0.10.0 (2015-03-15)

  • Fixed #18: Add an option to skip the top-level header when generating a ToC (thanks @jyasskin)
  • Split up getHeadingElementRank into getRankingHeadingElement and getRank
  • Section no longer has asHTML (out of scope)

v0.9.3 (2015-03-11)

  • Outline is not a separate object of its own
  • getSectionHeadingRank cleanup
  • Travis runs tests in both - jsdom v4.x and v3.x via jsdom-compat

v0.9.2 (2015-03-07)

  • Throw when non-sectioning root / content element passed in for outlining
  • Cleanup

v0.9.1 (2015-03-03)

  • More tests

v0.9.0 (2015-03-02)

  • Added [email protected] on io.js to the test matrix
  • Fixed implied headings to follow the spec - this actually means the previous implementation was incorrect - updated the following tests: navfirst, issue-13. Issue #13 was partly invalid.
  • Added more examples from the spec

v0.8.0 (2015-03-01)

  • Updated to the latest specified algorithm
  • Fixed #11: HTML entity escaping
  • Fixed #13: problems with sectioning root elements inside the outline
  • Properly handling of hgroup without any h1-h6 inside

v0.7.5 (2015-02-26)

  • Renamed grunt start-dev in favor a simpler grunt watch
  • Bookmarklet now goes via browserify
  • Bookmarklet works in Firefox again (fixes #6)
  • Fixed #9

v0.7.4 (2015-02-25)

  • Travis deploy (second try)

v0.7.3 (2015-02-25)

  • Travis deploy

v0.7.2 (2015-02-22)

  • Run tests on node 0.12 and io.js
  • Run tests in phantom.js as well as real browsers

v0.7.1 (2015-02-20)

  • README updates
  • ignore .grunt folder

v0.7.0 (2015-02-18)

  • Using browserify instead of concatenation
  • Made tests pass with jsdom
  • Updated browsers and dependencies

v0.6.3 (2014-06-06)

  • Replaced intern with buster

v0.6.2 (2014-06-05)

  • Using ejs to generate bookmarklet HTML
  • Using gh-pages to publish the bookmarklet

v0.6.0 (2014-06-04)

  • Using intern
  • Using SauceLabs
  • Using travis

v0.5.4 (2014-06-02)

  • Rewritten build scripts with grunt
  • Split away Chrome extension, removed Opera/Firefox extension code

v0.5.2 (2014-06-01)

  • First version published in npm

v0.5.1 and earlier

Originally lived on Google Code, if you like archeology

Contributors