Skip to content
bfoersterlingPublic

About

Markdown table of content generator / viewer / editor.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

57 Commits

Folders and files

Repository files navigation

mdtoc

  • Create markdown table of contents
  • Read individual chapters with syntax highlighting
  • Edit chapters with your $EDITOR
  • Makes it easy to work with large Markdown files
  • Fully Commonmark compliant

screenshot

installation

arch user repository

https://aur.archlinux.org/packages/mdtoc

yay -S mdtoc

download the latest release

make install_latest_release

Dependencies:

  • cmark
  • readline

build from source

make
sudo make install

usage

Without arguments mdtoc will print a table of content.

The most useful option is probably the interactive mode - -i.

In interactive mode you can type in the chapter numbering to print it.
Editing chapters is possible with e CHAPTER (or without CHAPTER to view the
most recently printed chapter.
Use s[earch] to search for a string in the file.
Or you can print the table of content with toc.

architecture

Written in C23.

Markdown is parsed by the Commonmark reference implementation.
(https://github.com/commonmark/cmark)

Headings are stored in a tree data structure.
Chapters are derived from headings and stored in a separate tree.
Chapters are needed for -c and -s options.

Out of tree headings will always be shown, as in Commonmark any document
is a valid Markdown document and this enables the user to fix the structure
of the document.

About

Markdown table of content generator / viewer / editor.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages