---
title: GitHub TOC Service 0.2.0
date: 2014-11-22 11:00
slug: github-toc-service-0-dot-2-0
categories:
- Code
tags:
- github
- markdown
- scripting
- service
- tagging
---

![](https://brettterpstra.com/uploads/2014/11/githubtoc.jpg)

I just uploaded the [GitHub TOC Service][orig] version 0.2.0. Mostly because I needed a break from testing the next version of Marked, but also because it had a few bugs that needed fixing.

This is a Service that scratches an itch for me when working on long README files and other Markdown documents. From the [original post][orig]:

> ...a script that works from the command line or as a Service. You can pipe Markdown to it, run it on a file, or select it and change it in place with the Service. You just put a `[toc]` tag in your document where you want the Table of Contents to go, and then run it. Any headers found after the point where the tag is will be indexed and linked

### What's new/fixed

- You can use "mmd" in the tag
	- `[toc 2 mmd]` creates a 2-level-deep header using MultiMarkdown style header ids instead of github-dash-format
- use `mmd` or `no_mmd` on the command line
	
		github_toc 2 mmd README.md
- Remembers depth and header style (stored in HTML comment) for repeat runs
	- update an existing Table of Contents without having to specify settings again, just select and run
- CLI arguments override "recorded" settings (no_mmd will erase mmd in tags)
- If there's more than one h1, it recognizes them as sections
- Fixes for github header id generation formatting
- Defaults to 2 levels instead of 1 if no depth is specified
- Fixed outputting to a second file without needing redirection on the command line

### Download

The [CLI version][gist] is updated, and the Service can be downloaded below (double click to install on OS XMountain Lion or higher).

**[Download GitHub TOC Service v0.2.0](https://brettterpstra.com/downloads/GitHubTOC0.2.0.zip)**

A Service for generating tables of contents for GitHub readmes (and other Markdown files).

[More info](https://brettterpstra.com/2014/07/01/github-toc-service/)

As a side note, [here's another take][gh-md-toc] on the process using only `curl` and `awk` to pull GitHub READMEs down and parse out a Table of Contents.

[orig]: http://brettterpstra.com/2014/07/01/github-toc-service/
[gist]: https://gist.github.com/ttscoff/c56fa651974ae6d86eee
[gh-md-toc]: https://github.com/ekalinin/github-markdown-toc

---

Brett is a writer and developer living in Minnesota, USA. You can follow him as ttscoff. This content is supported by readers like you. [More about Brett](https://brettterpstra.com/contact.md), including social links.

Copyright © 2026 Brett Terpstra. All rights reserved.
