Skip to content

sk1418/ghtoc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ghtoc readme file

		  __    __            
   ____ _/ /_  / /_____  _____
  / __ `/ __ \/ __/ __ \/ ___/
 / /_/ / / / / /_/ /_/ / /__  
 \__, /_/ /_/\__/\____/\___/  
/____/
	-- generate "toc" for markdown

Table of contents

(toc is generated by ghtoc)

Introduction

GitHub doesn't provide a [[toc]] like function to generate toc(Table of contents) for markdown file. But sometimes an outline of a long readme file or other markdown page is very helpful. That's why does the simple ghtoc come.

ghtoc was written and tested with python 2.7.8

Features & Limitation

  • auto backup the input file before toc was generated and inserted
  • currently only support converting ## Section-like format into toc.
  • doesn't support unicode characters in ##sections (the link generated by github doesn't work anyway)

Usage

toc.py <md file>

then open the <md file> and check if you are satisfied with the generated toc

License

MIT license

Showcase

ghtoc is so simple that itselves readme file won't contain much information. I just put here some example to let the toc in this page have some stuffs. Also it shows how the toc generated by ghtoc look like.

I am happy to be the Section 1

Section 1 is my boss

Hey, the guy above, you are my boss!
I am not boss at all,shame!

I stand on Section2 and I am empty

No you are not, In my subSection, you find characters

Here I test: "([<&>]) and *$#+"

OK, that's it

% vim: nofoldenable

About

generate toc for markdown file

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages