{"id":20619378,"url":"https://github.com/containerscrew/mtoc","last_synced_at":"2025-06-14T12:06:28.379Z","repository":{"id":255222835,"uuid":"848181018","full_name":"containerscrew/mtoc","owner":"containerscrew","description":"📄 Git markdown table of contents generator built with Rust.","archived":false,"fork":false,"pushed_at":"2025-05-27T20:15:56.000Z","size":314,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-27T21:26:11.614Z","etag":null,"topics":["cargo","clap","cli","crates-io","git","markdown","rust","table-of-contents","table-of-contents-generator"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/containerscrew.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-08-27T09:33:48.000Z","updated_at":"2025-05-27T20:15:52.000Z","dependencies_parsed_at":"2024-09-16T09:14:46.592Z","dependency_job_id":"40645cf6-3e90-4212-8840-9284fc556c92","html_url":"https://github.com/containerscrew/mtoc","commit_stats":null,"previous_names":["containerscrew/mtoc"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/containerscrew/mtoc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/containerscrew%2Fmtoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/containerscrew%2Fmtoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/containerscrew%2Fmtoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/containerscrew%2Fmtoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/containerscrew","download_url":"https://codeload.github.com/containerscrew/mtoc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/containerscrew%2Fmtoc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259813009,"owners_count":22915198,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cargo","clap","cli","crates-io","git","markdown","rust","table-of-contents","table-of-contents-generator"],"created_at":"2024-11-16T12:11:31.277Z","updated_at":"2025-06-14T12:06:28.358Z","avatar_url":"https://github.com/containerscrew.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"logo.png\" alt=\"logo\" width=\"250\"/\u003e\n    \u003ch3 align=\"center\"\u003emtoc 📄\u003c/h3\u003e\n    \u003cp align=\"center\"\u003eMarkdown table of contents generator\u003c/p\u003e\n    \u003cp align=\"center\"\u003eBuilt with ❤ in Rust\u003c/p\u003e\n\u003c/p\u003e\n\n\u003c!-- START OF TOC !DO NOT EDIT THIS CONTENT MANUALLY--\u003e\n**Table of Contents**  *generated with [mtoc](https://github.com/containerscrew/mtoc)*\n- [Introduction](#introduction)\n- [Badges](#badges)\n- [Supported Platforms](#supported-platforms)\n- [Installation](#installation)\n  - [Install latest binary version](#install-latest-binary-version)\n  - [Install specific binary version](#install-specific-binary-version)\n  - [Install using cargo](#install-using-cargo)\n- [Uninstall](#uninstall)\n- [Usage](#usage)\n  - [Help](#help)\n  - [Generate TOC](#generate-toc)\n  - [Generate TOC for a specific directory](#generate-toc-for-a-specific-directory)\n  - [Exclude directories from search](#exclude-directories-from-search)\n  - [Generate TOC for a specific file](#generate-toc-for-a-specific-file)\n- [Using pre-commit](#using-pre-commit)\n- [Example](#example)\n- [Local development](#local-development)\n- [IN PROGRESS](#in-progress)\n- [License](#license)\n\u003c!-- END OF TOC --\u003e\n\n# Introduction\n\n**From this:**\n\n```markdown\n# Hello\n## World\n### How are you?\n```\n\n**To this:**\n\n```markdown\n\u003c!-- START OF TOC !DO NOT EDIT THIS CONTENT MANUALLY--\u003e\n**Table of Contents**  *generated with [mtoc](https://github.com/containerscrew/mtoc)*\n- [Hello](#hello)\n  - [World](#world)\n    - [How are you?](#how-are-you?)\n\u003c!-- END OF TOC --\u003e\n```\n\n# Badges\n\n|               |                                                                                                                                                                                                                                                 |\n|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Total downloads | ![Crates.io Total Downloads](https://img.shields.io/crates/d/mtoc?color=orange)|\n| Language      | ![Rust](https://img.shields.io/badge/rust-%23000000.svg?style=for-the-badge\u0026logo=rust\u0026logoColor=white)                                                                                                                                          |\n| Crates        | ![Crates.io Version](https://img.shields.io/crates/v/mtoc)                                                                                                                                                                                      |\n| Github Release       | [![Release](https://img.shields.io/github/release/containerscrew/mtoc)](https://github.com/containerscrew/mtoc/releases/latest)                                                                                                                 |\n| Code          | ![Code Size](https://img.shields.io/github/languages/code-size/containerscrew/mtoc)                                                                                                                                                             |\n| CI - Build    | [![Build](https://github.com/containerscrew/mtoc/actions/workflows/build.yml/badge.svg)](https://github.com/containerscrew/mtoc/actions/workflows/build.yml)                                                                                    |\n| CI - Release  | [![Build](https://github.com/containerscrew/mtoc/actions/workflows/release.yml/badge.svg)](https://github.com/containerscrew/mtoc/actions/workflows/release.yml)                                                                                |\n| CI - Test     | [![Build](https://github.com/containerscrew/mtoc/actions/workflows/test.yml/badge.svg)](https://github.com/containerscrew/mtoc/actions/workflows/test.yml)                                                                                      |\n| CI - Coverage | [![Build](https://github.com/containerscrew/mtoc/actions/workflows/coverage.yml/badge.svg)](https://github.com/containerscrew/mtoc/actions/workflows/coverage.yml)                                                                              |\n| Meta          | [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit\u0026logoColor=white)](https://github.com/pre-commit/pre-commit) [![License - MIT](https://img.shields.io/github/license/containerscrew/mtoc)](/LICENSE) |\n| Codecov       | [![codecov](https://codecov.io/github/containerscrew/mtoc/graph/badge.svg?token=UTTEOR9BUO)](https://codecov.io/github/containerscrew/mtoc)                                                                                                     |\n\n\n# Supported Platforms\n\n| Arch    | ARM64 | AMD64 |\n|---------|------|------|\n| darwin  | ✅    | ✅  |\n| linux   | ✅    | ✅  |\n| windows | ❌     | ❌   |\n\n\u003e Maybe in windows systems this tool will work, but has not been tested\n\n# Installation\n\n## Install latest binary version\n\n```shell\ncurl --proto '=https' --tlsv1.2 -sSfL https://raw.githubusercontent.com/containerscrew/mtoc/main/install.sh | sh\n```\n\n## Install specific binary version\n\n```shell\ncurl --proto '=https' --tlsv1.2 -sSfL https://raw.githubusercontent.com/containerscrew/mtoc/main/install.sh | sh -s -- -v \"v0.8.0\"\n```\n\n## Install using cargo\n\n* **[Install Cargo](https://rustup.rs/)**\n\n```shell\ncargo install mtoc\n```\n\n\u003e If you want to update the tool to a new version, just the run the same command `cargo install mtoc`.\n\n# Uninstall\n\nBinary:\n\n```bash\nsudo rm /usr/local/bin/mtoc\n```\n\nWith cargo:\n\n```shell\ncargo uninstall mtoc\n```\n\n# Usage\n\nBy default, the command will search for markdown files in the current directory and generate the table of contents for each file. But, you can specify a directory to search for markdown files, specify only a specific file, or exclude directories from the search.\n\n## Help\n\n```bash\n$ mtoc --help\n\nGit markdown table of contents generator.\n\nUsage: mtoc [OPTIONS]\n\nOptions:\n  -d, --directory \u003cDIRECTORY\u003e     Directory to search for markdown files [default: .]\n  -e, --exclude-dir \u003cEXCLUDE\u003e...  Exclude directories from search\n  -f, --file \u003cFILE\u003e...            Only generate TOC for the specified file(s)\n  -h, --help                      Print help\n  -V, --version                   Print version\n```\n\n## Generate TOC\n\n```bash\nmtoc # default the current dir where the command is executed. All the files, all the directories will be scanned.\n```\n\n## Generate TOC for a specific directory\n\n```bash\nmtoc -d /path/to/directory\n```\n\n## Exclude directories from search\n\n```bash\nmtoc -e \".target/\" -e \".node_modules/\"\n```\n\n## Generate TOC for a specific file\n\n```bash\nmtoc -f README.md\n```\n\n# Using pre-commit\n\nAdd this configuration to your `.pre-commit-config.yaml`\n\n```yaml\n  - repo: https://github.com/containerscrew/mtoc\n    rev: v0.5.0 # use the most recent tag\n    hooks:\n      - id: mtoc\n        args: [ \"-e\", \".target/\" ]\n```\n\n\u003e Always stay up to date with the latest changes in the project markdown files.\n\n# Example\n\n```bash\n$ mtoc -e \".target/\"                                                                                                                                                                                                                                         🦀 v1.80.1\nExcluding directories  [\".target/\"]\nUpdated markdown file  ./docs/test.md\nUpdated markdown file  ./CHANGELOG.md\nUpdated markdown file  ./README.md\n```\n\n# Local development\n\n1. Make your changes\n2. Run pre-commit\n3. Test and build pipelines must pass\n\n```bash\n$ pre-commit install\n# Or run once\n$ pre-commit run -a\n```\n\n# IN PROGRESS\n\n[IN PROGRESS](./docs/todo.md)\n\n# License\n\n`mtoc` is distributed under the terms of the [`GNU AFFERO GENERAL PUBLIC LICENSE`](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontainerscrew%2Fmtoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcontainerscrew%2Fmtoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontainerscrew%2Fmtoc/lists"}