package toc

  1. Overview
  2. Docs
A generator of table of contents for Github Markdown files

Install

Dune Dependency

Authors

Maintainers

Sources

toc-0.1.0.tbz
sha256=39b0838e508e1b54bf26c8c32efb2206e726a5ae6aceaafaa26d0df51293ec44
sha512=c34e54770b70f1892c548838f5d123b222c7cfbe17f40a9f9f02663936665d6088200d8282fee0810544dcf94c4bd30861fb72f15680f8f0c955db8c6da0690c

Description

Published: 15 Nov 2022

README

TOC - Manage Tables of Contents in Markdown Files

This repository contains a simple utility to manage tables of contents for Github Markdown files.

Usage

First Use

Run:

$ toc README.md
README.md has been updated.

This will replace any [toc] tokens by the file's table of contents instead.

-[toc]
+<div class="toc">
+
+* [Usage](#Usage)
+  * [First Use](#First-Use)
+  * [Regenerate TOC](#Regenerate-TOC)
+  * [Multiple TOC](#Multiple-TOC)
+  * [Options](#Options)
+    * [Print](#Print)
+    * [Depth](#Depth)
+* [License](#License)
+
+</div>

Regenerate TOC

toc adds transparent <div> markers around the generated table of contents. Hence, the next call to toc will update the table correctly.

To regenerate the TOC, run:

$ toc README.md
README.md has been updated.

Multiple TOC

Use as many [toc] as you like to define multiple table of contents the same file.

Options

Use toc --help to see all the options.

Print
$ toc README.md -p
* Usage
  * First Use
  * Regenerate TOC
  * Multiple TOC
  * Options
    * Print
    * Depth
* License
Depth

Use --depth to control the depth of the table of contents.

$ toc README.md -p -d 1
* Usage
* License

License

ISC. See the LICENSE file.

Dependencies (7)

  1. astring
  2. fmt
  3. logs
  4. cmdliner >= "1.1.0"
  5. omd >= "2.0.0~alpha2"
  6. dune >= "3.5"
  7. ocaml

Dev Dependencies (2)

  1. odoc with-doc
  2. alcotest with-test

Used by

None

Conflicts

None