🚀 Launch Week Day 5:Introducing Immutable Scans.Learn More →
Socket
Book a DemoInstallSign in
Socket

sigs.k8s.io/mdtoc

Package Overview
Dependencies
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sigs.k8s.io/mdtoc

Go Modules
Version
v1.4.0
Version published
Created
Source

Markdown Table of Contents Generator

mdtoc is a utility for generating a table-of-contents for markdown files.

Only github-flavored markdown is currently supported, but I am open to accepting patches to add other formats.

Table of Contents

Generated with mdtoc --inplace README.md

  • Usage
  • Installation
  • Community, discussion, contribution, and support

Usage

Usage: mdtoc [OPTIONS] [FILE]... Generate a table of contents for a markdown file (github flavor).

TOC may be wrapped in a pair of tags to allow in-place updates:

<!-- toc -->
generated TOC goes here
<!-- /toc -->

TOC indentation is normalized, so the shallowest header has indentation 0.

Options:

--dryrun - Whether to check for changes to TOC, rather than overwriting. Requires --inplace flag. Exit code 1 if there are changes.

--inplace - Whether to edit the file in-place, or output to STDOUT. Requires toc tags to be present.

--skip-prefix - Whether to ignore any headers before the opening toc tag. (default true)

For example, with --skip-prefix=false the TOC for this file becomes:

- [Markdown Table of Contents Generator](#markdown-table-of-contents-generator)
- [Table of Contents](#table-of-contents)
  - [Usage](#usage)
  - [Installation](#installation)

Installation

On linux, simply download and run the standalone release binary

# Optional: Verify the file integrity - check the release notes for the expected value.
$ sha256sum $BINARY
$ chmod +x $BINARY

Or, if you have a go development environment set up:

go install sigs.k8s.io/mdtoc@latest

Community, discussion, contribution, and support

Learn how to engage with the Kubernetes community on the community page.

You can reach the maintainers of this project at:

Code of conduct

Participation in the Kubernetes community is governed by the Kubernetes Code of Conduct.

FAQs

Package last updated on 09 Jul 2024

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