jQuery plugin to generate a table of contents

Overview

jquery.contentify

A jQuery plugin to generate a table of contents

Usage

The below code snippet shows how to create the table of contents in a container with ID toc.

$('#toc').contentify({
  title:            'Table of Contents',
  headingSelectors: ['h1', 'h2', 'h3'],
  scrollDuration:   500
});

The contentify function accepts a settings object with the following properties:

  • title - The heading that will appear on top of the table of contents (default: none / empty string)
  • headingSelectors - An array of selectors that should be used to identify headings. The selector at index i will be used to locate headings on the i-th level (default ['h1', 'h2', 'h3', 'h4', 'h5']).
  • scrollDuration - Duration of the scrolling animation in milliseconds (default: 1000)

The title of the table of contents is wrapped in a <div> with a CSS class of contentify_title. Moreover, the indivual sections are wrapped in <ol> lists with a CSS class of contentify_i where i is the level of the section.

What Doesn't Work Yet

  • Only one single selector can be specified for each level of headings. It would be nice to be able to specify an array of selectors for each level of headings.
  • The CSS class names of the table of contents cannot be customized
  • It is not possible to restrict the area of the document that should be scanned for headings. The whole document will be used to compile the table of contents.
You might also like...

Apinto document project, which includes the use tutorials, development documents and other related contents of apinto.

apinto-docs Apinto document project, which includes the use tutorials, development documents and other related contents of apinto. README 本文档由 VuePres

Dec 1, 2022

This project scans yandex disk folders that are open to public sharing and allows you to download their contents.

This project scans yandex disk folders that are open to public sharing and allows you to download their contents.

kitapbar.com Development start mongodb server docker-compose -f docker-compose.dev.yaml up -d yandex service cd services/yandex create a .env file by

Oct 15, 2022

JS Irontable - A responsive Jquery Table for multiple purposes

JSIronTable JS IronTable - A responsive Jquery Table for multiple purposes This table provides a responsive JQuery table which includes: Column Sortin

May 26, 2021

a lightweight, dependency-free JavaScript plugin which makes a HTML table interactive

JSTable The JSTable is a lightweight, dependency-free JavaScript plugin which makes a HTML table interactive. The plugin is similar to the jQuery data

Oct 20, 2022

Advanced table plugin

Advanced table plugin

Grid.js Advanced table plugin A table library that works everywhere Simple and lightweight implementation No vendor lock-in. Grid.js can be used with

Jan 2, 2023

The JSTable is a lightweight, dependency-free JavaScript plugin which makes a HTML table interactive

The JSTable is a lightweight, dependency-free JavaScript plugin which makes a HTML table interactive. The plugin is similar to the jQuery data

Oct 20, 2022

Generate deterministic fake values: The same input will always generate the same fake-output.

Generate deterministic fake values: The same input will always generate the same fake-output.

import { copycat } from '@snaplet/copycat' copycat.email('foo') // = '[email protected]' copycat.email('bar') // = 'Thurman.Schowalter668@

Dec 30, 2022

JQuery charCounter - jQuery Character Counter Plugin

JQuery charCounter - jQuery Character Counter Plugin

jQuery Character Counter A jQuery based character counter for input and textarea HTML tags. What is this? This simple plugin allows you to add a c

Aug 10, 2022

jQuery quick notification plugin. jQuery плагин быстрых уведомлений

Note: English translation by Google Translate Notific About Description: this is a jQuery plugin that helps you display notifications on your site. Li

Nov 7, 2021
Owner
Johannes Marbach
Matrix: h3nn3s:matrix.org | GitLab: https://gitlab.com/cherrypicker
Johannes Marbach
A userscript to spice your GitHub sidebar with an easy-to-use Table of Contents!

GitHub Sidebar ToC "... finally using that wasted sidebar space" – radiantly Installation You will need a userscript manager like Violentmonkey. Insta

Joshua T. 3 Mar 12, 2022
Waypoint - Automatic Table of Contents Generator for Obsidian.md

Waypoint - Automatic Table of Contents Generator for Obsidian.md Do you use folders to categorize your notes and wish that Obsidian would show certain

Idrees 153 Jan 2, 2023
Table of contents Trilium widget for editable and readonly text notes.

Trilium-TocWidget Table of contents Trilium widget for editable and readonly text notes. Screenshot Features The ToC is live and automatically updated

Antonio Tejada 25 Dec 29, 2022
A vanilla JavaScript library that automatically generates the "Table of Contents" of an HTML document.

DocumentOutline.js DocumentOutline is a vanilla JavaScript library that automatically generates the "Table of Contents" of an HTML document. See a liv

Angelo Faella 3 Jul 12, 2021
Add a table of contents to the sidebar of your GitHub issues and pull requests.

github-sidebar-jump-extension Getting started ?? Build locally Checkout the repository to your local machine Run npm install to install all required d

Jason Barry 11 Sep 7, 2022
Show floating sticky outline (table of contents) for Notion pages, powered by nbundle.

Notion Outline Show floating sticky outline (table of contents) for Notion pages, powered by nbundle. This is an nbundle-powered Notion app bootstrapp

nbundle 11 Nov 10, 2022
✏️ A small jQuery extension to turn a static HTML table into an editable one. For quickly populating a small table with JSON data, letting the user modify it with validation, and then getting JSON data back out.

jquery-editable-table A small jQuery extension to turn an HTML table editable for fast data entry and validation Demo ?? https://jsfiddle.net/torrobin

Tor 7 Jul 31, 2022
Another table select prompt plugin of inquirer.js, with powerful table render and filters.

inquirer-table-select-prompt Table row selection prompt for Inquirer.js 动机 现有的 inquirer.js 没有支持表格行选中的命令行交互的插件. 社区内能查找到的,只有一个二维数组的 checkbox,eduardobouc

锂电 3 Jan 7, 2023
A plugin for generate markdown table quickly like Typora.

Obsidian Table Generator A plugin for generate markdown table quickly like Typora. Features You can use obsidian-table-generator to generate markdown

Boninall 58 Dec 30, 2022
Validate directory structure and file contents with an extension of JSON schema.

directory-schema-validator Description Validate directory structure and file contents with an extension of JSON schema. Install Install using NPM or s

Justin Poehnelt 5 Nov 1, 2022