Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

outliner

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

outliner

html5 page outliner

  • 0.1.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Outliner

A tool for creating a document-outline based on HTML5 sections and subsections within an article.

Older documents that use h1-h6 are not handled.

Installation

npm install outliner --save-dev

Usage

  • Get a handle on the module, e.g. var uoptoc = require("outliner")
  • Call uoptoc.gen(startNode) passing in a DOM node and it will search the descendant tree for all sections and subsections. Each section is given a unique ID if it does not already have one. A nested unordered lists that reflects the structure is returned containing a link to each section.
  • uoptoc.genPop(startNode, destNode) works as uoptoc.gen(startNode) except that the resulting UL is appended to the document's destNode element that is passed.
  • genPopSelector works as uoptoc.genPop(startNode, destNode) but css selectors for the start and destination nodes are passed.

Dependencies

It uses the JSDOM module, so pass-in JSDOM module objects.

History

0.1.4 Added toc ID to generated content 0.1.x The Earth cooled...

Keywords

FAQs

Package last updated on 04 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc