All Projects → ycd → Toc

ycd / Toc

Licence: apache-2.0
🚩 TOC, zero configuration table of content generator for Markdown files, create table of contents from any Markdown file with ease.

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Toc

Ok Mdx
Browser-based MDX editor
Stars: ✭ 681 (+931.82%)
Mutual labels:  cli, markdown
Curlie
The power of curl, the ease of use of httpie.
Stars: ✭ 877 (+1228.79%)
Mutual labels:  cli, developer-tools
Friends
Spend time with the people you care about. Introvert-tested. Extrovert-approved.
Stars: ✭ 737 (+1016.67%)
Mutual labels:  cli, markdown
Wsta
A CLI development tool for WebSocket APIs
Stars: ✭ 611 (+825.76%)
Mutual labels:  cli, developer-tools
Mkcli
Markdown command line interface definition
Stars: ✭ 56 (-15.15%)
Mutual labels:  cli, markdown
Hostctl
Your dev tool to manage /etc/hosts like a pro!
Stars: ✭ 642 (+872.73%)
Mutual labels:  cli, developer-tools
Gita
Manage many git repos with sanity 从容管理多个git库
Stars: ✭ 865 (+1210.61%)
Mutual labels:  cli, developer-tools
Mask
🎭 A CLI task runner defined by a simple markdown file
Stars: ✭ 495 (+650%)
Mutual labels:  cli, markdown
Influx Prompt
An interactive command-line InfluxDB cli with auto completion.
Stars: ✭ 42 (-36.36%)
Mutual labels:  cli, developer-tools
Termd
Render markdown in the terminal
Stars: ✭ 32 (-51.52%)
Mutual labels:  cli, markdown
Marp Cli
A CLI interface for Marp and Marpit based converters
Stars: ✭ 606 (+818.18%)
Mutual labels:  cli, markdown
Wago
Automate the actions you do after saving code.
Stars: ✭ 60 (-9.09%)
Mutual labels:  cli, developer-tools
Terragrunt
Terragrunt is a thin wrapper for Terraform that provides extra tools for working with multiple Terraform modules.
Stars: ✭ 5,446 (+8151.52%)
Mutual labels:  cli, developer-tools
Backslide
💦 CLI tool for making HTML presentations with Remark.js using Markdown
Stars: ✭ 679 (+928.79%)
Mutual labels:  cli, markdown
Saws
A supercharged AWS command line interface (CLI).
Stars: ✭ 4,886 (+7303.03%)
Mutual labels:  cli, developer-tools
Glow
Render markdown on the CLI, with pizzazz! 💅🏻
Stars: ✭ 7,596 (+11409.09%)
Mutual labels:  cli, markdown
Md To Pdf
Hackable CLI tool for converting Markdown files to PDF using Node.js and headless Chrome.
Stars: ✭ 374 (+466.67%)
Mutual labels:  cli, markdown
Npkill
List any node_modules directories in your system, as well as the space they take up. You can then select which ones you want to erase to free up space.
Stars: ✭ 5,325 (+7968.18%)
Mutual labels:  cli, developer-tools
Hint
重构到 ---> https://github.com/hustcc/lint-md
Stars: ✭ 30 (-54.55%)
Mutual labels:  cli, markdown
Http Prompt
An interactive command-line HTTP and API testing client built on top of HTTPie featuring autocomplete, syntax highlighting, and more. https://twitter.com/httpie
Stars: ✭ 8,329 (+12519.7%)
Mutual labels:  cli, developer-tools

toc

toc TOC, table of content generator for Markdown files

toc gif

Table of Contents


Usage

Usage: toc [options]
Options:
	-p, --path      <path>   Path for the markdown file.                               [REQUIRED]
	-a, --append    <bool>   Append toc after <!--toc-->, or write to stdout.          [Default: true]
	-b, --bulleted  <bool>   Write as bulleted, or write as numbered list.             [Default: true] 
	-s, --skip      <int>    Skip the first given number of headers.                   [Default: 0]
	-d, --depth     <int>    Set the number of maximum heading level to be included.   [Default: 6]
	-h, --help               Show this message and exit.

Add <!--toc--> to your markdown to the place where you want to add Table of Contents. That's it.

Give the markdown file as an input with -p, --path flags.

$ toc -p path/to/markdown.md

Create numbered list instead of bulleted list.

$ toc --bulleted=false

Write result to standard output instead of appending.

$ toc --append=false

Skip the first n number of headers via -s, --skip flags.

$ toc --skip 2

Set the number of maximum heading level to be included with -d, --depth flags.

Set maximum heading level to 3 (h3)

$ toc --depth 3

Installation

Packages

Arch Linux

  • [ ] For Arch Linux, install the `` package.

Homebrew

  • [ ] For Homebrew on macOS, install the `` formula.

Docker

It is available via two tags.

You can either use latest or $VERSION.

docker run --rm -it yagizcan/toc:latest toc

Downloads

Binary downloads of example are available from the releases section on GitHub for 64-bit Windows, macOS, and Linux targets. They contain the compiled executable.

platform
macOS 64 Bit
Linux 32-Bit
Linux ARM 64 Bit
Linux 64 Bit
Windows 64 Bit
Windows 32 Bit

Installation from source

  1. Verify that you have Go 1.13+ installed

    $ go version
    

    If go is not installed, follow instructions on the Go website.

  2. Clone this repository

    $ git clone https://github.com/ycd/toc 
    $ cd ycd
    
  3. Build and install

    Unix/Linux

    # May require you to use sudo
    $ go build .
    $ cp toc /usr/local/toc
    
  4. Verify installation

    $ toc -h 
    
    Usage: toc [options]
    Options:
       -p, --path      <path>   Path for the markdown file.                               [REQUIRED]
       -a, --append    <bool>   Append toc after <!--toc-->, or write to stdout.          [Default: true]
       -b, --bulleted  <bool>   Write as bulleted, or write as numbered list.             [Default: true] 
       -s, --skip      <int>    Skip the first given number of headers.                   [Default: 0]
       -d, --depth     <int>    Set the number of maximum heading level to be included.   [Default: 6]
       -h, --help               Show this message and exit.
    

Contributing

All kinds of Pull Requests and Feature Requests are welcomed!

Licence

toc's source code is licenced under the Apache 2.0 License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].