{ "info": { "author": "Xie Wei", "author_email": "ampedee@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: MacOS", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Terminals", "Topic :: Text Editors :: Text Processing", "Topic :: Text Processing" ], "description": "# gfm-toc\n\n[\u4e2d\u6587\u6587\u6863]() | [README]()\n\n## Table of Contents\n\n - [Overview](#overview)\n - [Installation](#installation)\n - [Usage](#usage)\n - [Single file](#single-file)\n - [Multiple files](#multiple-files)\n - [Configuration](#configuration)\n - [customize the header level](#customize-the-header-level)\n - [Write results to a file or print to standard output](#write-results-to-a-file-or-print-to-standard-output)\n - [Add a title to the generated TOC](#add-a-title-to-the-generated-toc)\n - [Dependency](#dependency)\n - [License](#license)\n\n## Overview\n\nEasy and customizable way to **generate TOC** for README.md on GitHub.\n\n- Automatically generate table of contents in accordance with Github Favored Markdown format\n- Just a single .py file can be done with no other dependencies\n- Support for text content in both Chinese and English languages\n- Support for customizing the header level of the table of contents\n- Supports automatic write results to files, and also can print results to standard output for further processing\n- Supports generating table of contents for multiple files at the same time\n- Support for repeating headers, filtering headers in code blocks\n\nIf you don't want to download any files or read the command instructions below, you can try my online build tool.\n\n## Installation\n\n**Pypi**\n\n```bash\n$ pip3 install gfm-toc --upgrade\n```\n\n**Manually**\n\n```bash\n$ git clone https://github.com/waynerv/github-markdown-toc\n$ cd github-markdown-toc\n$ python3 setup.py install\n```\n\nYou can also directly download the file `gfm_toc/md_toc.py` in the repository and run this script manually like this:\n\n```bash\n$ python3 md-toc.py [-h] [-s {1,2,3,4,5,6}] [-e {1,2,3,4,5,6}] [-o] file [file ...]\n```\n\n## Usage\n\nThe command syntax is as follows\uff1a\n\n```bash\n$ gfm-toc [-h] [-s {1,2,3,4,5,6}] [-e {1,2,3,4,5,6}] [-o] file [file ...]\n```\n\nRun the command as follows to get help information for the command options\uff08you can replace `-h` with `--help`).:\n\n```bash\n$ gfm-toc -h\n```\n\nNote: Make sure your device has successfully installed Python3 before run it.\n\n### Single file\n\nAutomatically generate **TOC** for a single markdown file and print result to standard output with only 2-4 title levels:\n\n```bash\n$ gfm-toc -s 2 -e 4 -o README_eng.md\nGenerate from file: README_eng.md\n\n- [Table of Contents](#table-of-contents)\n- [md-toc](#md-toc)\n- [Installation](#installation)\n- [Usage](#usage)\n - [Single file](#single-file)\n - [Multiple files](#multiple-files)\n - [Configuration](#configuration)\n - [customize the title level](#customize--the-title-level)\n - [Write results to a file or print to standard output](#write-results-to-a-file-or-print-to-standard-output)\n- [Dependency](#dependency)\n\nTable of contents generated.\n```\n\nThen copy/paste result between prompt sentence from console into original README.md.\n\n### Multiple files\n\nUse the default configuration to generate **TOC** for multiple markdown files and write them to a file separately:\n\n```bash\n$ gfm-toc file01.md file02.md file03.md\nTable of contents generated.\n```\n\nHere's an example\uff1a\n\n- [File_without_TOC.md](https://github.com/waynerv/github-markdown-toc/blob/master/examples/File_without_TOC.md)\n\nAfter generating **TOC** and writing to the file\uff1a\n\n- [File_with_TOC.md](https://github.com/waynerv/github-markdown-toc/blob/master/examples/File_with_TOC.md)\n\n### Configuration\n\n#### customize the header level\n\nUse the command line options `-s` or `--start` and add parameters to set the start header level of **TOC**. The default value of the parameter is 1.\n\nUse the command line options `-e` or `--end` and add parameters to set the end header level of **TOC**. The default value of the parameter is 6.\n\nThe title level parameter must be an integer between 1 and 6, and the start header level cannot be greater than the end header level.\n\n```bash\n-s {1,2,3,4,5,6}, --start {1,2,3,4,5,6} choose the start level of TOC, default value is 1\n-e {1,2,3,4,5,6}, --end {1,2,3,4,5,6} choose the end level of TOC, default value is 6\n```\n\nGenerate **TOC** of 1-6 header levels (default option):\n\n```bash\n$ gfm-toc test/Mastering_Markdown.md -o\nGenerate from file: test/Mastering_Markdown.md\n\n- [Mastering Markdown](#mastering-markdown)\n - [What is Markdown?](#what-is-markdown)\n - [Examples](#examples)\n - [Syntax guide](#syntax-guide)\n - [Headers](#headers)\n - [Emphasis](#emphasis)\n - [Lists](#lists)\n - [Unordered](#unordered)\n - [Ordered](#ordered)\n - [Images](#images)\n - [Links](#links)\n - [Blockquotes](#blockquotes)\n - [Inline code](#inline-code)\n\nTable of contents generated.\n```\n\nOnly generate 2-3 header levels:\n\n```bash\n$ gfm-toc examples/Mastering_Markdown.md -o -s 2 -e 3\nGenerate from file: examples/Mastering_Markdown.md\n\n- [What is Markdown?](#what-is-markdown)\n- [Examples](#examples)\n- [Syntax guide](#syntax-guide)\n - [Headers](#headers)\n - [Emphasis](#emphasis)\n - [Lists](#lists)\n - [Images](#images)\n - [Links](#links)\n - [Blockquotes](#blockquotes)\n - [Inline code](#inline-code)\n\nTable of contents generated.\n```\n\n#### Write results to a file or print to standard output\n\nBy default, the program automatically writes the generated **TOC** to the beginning of the original file.\n\nAdd the option `-o` or `--output` when you want to print the results to standard output for copying or other processing.\n\n```bash\n-o, --output print toc to stdout instead of writing to file\n```\n\nUse the `>` on the command line to export the generated directory to a separate file:\n\n```bash\n$ gfm-toc -o README.md > table_of_content.md\n```\n\n#### Add a title to the generated TOC\n\nThis option is not very common, because in many cases, people write Markdown documents according to different specifications or their own habits. But if you need, you can add `-t` or `--title` options when executing commands. This will add a level 2 header called `Table of contens` to the generated **TOC**, as follows:\n\n```bash\n$ gfm-toc examples/Mastering_Markdown.md -o -s 2 -e 3 -t\nGenerate from file: examples/Mastering_Markdown.md\n\n## Table of contents\n\n- [What is Markdown?](#what-is-markdown)\n- [Examples](#examples)\n- [Syntax guide](#syntax-guide)\n - [Headers](#headers)\n - [Emphasis](#emphasis)\n - [Lists](#lists)\n - [Images](#images)\n - [Links](#links)\n - [Blockquotes](#blockquotes)\n - [Inline code](#inline-code)\n\nTable of contents generated.\n```\n\n## Dependency\n\n- Python3\n\nTested on Ubuntu 18.04 in bash with Python 3.6.7.\n\n## License\n\nMIT\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/waynerv/github-markdown-toc", "keywords": "markdown md github gfm table of contents toc", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "gfm-toc", "package_url": "https://pypi.org/project/gfm-toc/", "platform": "Linux & OSX", "project_url": "https://pypi.org/project/gfm-toc/", "project_urls": { "Homepage": "https://github.com/waynerv/github-markdown-toc" }, "release_url": "https://pypi.org/project/gfm-toc/0.0.7/", "requires_dist": null, "requires_python": "", "summary": "Simple and customizable way to generate TOC for Github Markdown files.", "version": "0.0.7" }, "last_serial": 5109269, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "98663d59912f9a17507d1ba9da2032c0", "sha256": "783cd800785a2f9cded282398fabdbc720c0138c15f5a5aa43e4caefe0fe8aab" }, "downloads": -1, "filename": "gfm_toc-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "98663d59912f9a17507d1ba9da2032c0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8974, "upload_time": "2019-03-25T09:55:52", "url": "https://files.pythonhosted.org/packages/1e/2f/231952d8a9a8ad5acfef4784c39df011e4c954de188551c6ef26a444d577/gfm_toc-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a4b9433390f1168e84cb83dcb997614c", "sha256": "ac196d1211d69b3840ed064f7d0ee85326cf822768a60caf723f97c956a2c0f5" }, "downloads": -1, "filename": "gfm-toc-0.0.1.tar.gz", "has_sig": false, "md5_digest": "a4b9433390f1168e84cb83dcb997614c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5965, "upload_time": "2019-03-25T09:55:55", "url": "https://files.pythonhosted.org/packages/f8/54/da23169f41346be4e329637f02d406e1a58d4511c04fe9ef1c397ab73ad1/gfm-toc-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "710d58b757aa2efbe6fa19e11530ae64", "sha256": "28d197333b47036558816806b8a866138e617c01d6b07c12299fd6171b09c4b2" }, "downloads": -1, "filename": "gfm_toc-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "710d58b757aa2efbe6fa19e11530ae64", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9012, "upload_time": "2019-03-25T10:42:49", "url": "https://files.pythonhosted.org/packages/c9/0b/ffc8b9d3bdb13cc6451409cfc517b1eb251e7859d2a29af03c534a317643/gfm_toc-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "83a5b7d25f5cf754995df9935d0709a2", "sha256": "009330a1c6b246a528efdb1af66b5d9d0e334207059911791b9c7e61101ee566" }, "downloads": -1, "filename": "gfm-toc-0.0.2.tar.gz", "has_sig": false, "md5_digest": "83a5b7d25f5cf754995df9935d0709a2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5950, "upload_time": "2019-03-25T10:42:51", "url": "https://files.pythonhosted.org/packages/69/0d/1458a53ce37b3f8cc2eb67f5c0b9bd44f60a4339922622500c4e54eb2738/gfm-toc-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "9be384dff1e12b3227626b3a151c58e1", "sha256": "caebe5d45192bfd036b30a73f0ae71a5ba7278304616c6fdaf3ca4c352c30523" }, "downloads": -1, "filename": "gfm_toc-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "9be384dff1e12b3227626b3a151c58e1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6725, "upload_time": "2019-03-25T11:06:03", "url": "https://files.pythonhosted.org/packages/16/ab/852873f4d3796ba0ba42aebe96374cb8348fc8d79c26ea345b43cdceeabc/gfm_toc-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c4d25f856d6e74b0067d12097b4a8715", "sha256": "2877b8f39879d66e90937d17f44627253eafb1faf64a6b03dd0fdd5671bf5ce3" }, "downloads": -1, "filename": "gfm-toc-0.0.3.tar.gz", "has_sig": false, "md5_digest": "c4d25f856d6e74b0067d12097b4a8715", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5942, "upload_time": "2019-03-25T11:06:05", "url": "https://files.pythonhosted.org/packages/15/0a/8f793a1611fbe73381fb191a37c7898e49de79576f3cad1f2feadf83de9c/gfm-toc-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "35586dc5b9890e2386324f20160a6adb", "sha256": "3d1f9f93cc4f391ccc830e747c5c182502ead154417d914d2b4b51eb7d77d2df" }, "downloads": -1, "filename": "gfm_toc-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "35586dc5b9890e2386324f20160a6adb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6763, "upload_time": "2019-03-25T12:54:53", "url": "https://files.pythonhosted.org/packages/90/fb/e310576c0254a1262facd1dd6b74154b28575d80117601133fb54ebccaee/gfm_toc-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "43713ac518e78bfdb1d75dd1bdaa203e", "sha256": "d9dbc75fb58a51eccfa983afd56f11ba68ff8a7b1e53c58d41501ddb3e92ff7c" }, "downloads": -1, "filename": "gfm-toc-0.0.4.tar.gz", "has_sig": false, "md5_digest": "43713ac518e78bfdb1d75dd1bdaa203e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5995, "upload_time": "2019-03-25T12:54:55", "url": "https://files.pythonhosted.org/packages/29/d3/fdebd04673663e5a750500c4b92d07af251345e22eafe4d71e5da2c7b667/gfm-toc-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "d3fe6ce7ce4edb8eb6b1e63f9c46d7b6", "sha256": "cc3a110b54504d0a12d3cc0bc28aafc4ac0982d689c0432f3855add04a2f6ba2" }, "downloads": -1, "filename": "gfm_toc-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "d3fe6ce7ce4edb8eb6b1e63f9c46d7b6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6763, "upload_time": "2019-03-26T02:59:21", "url": "https://files.pythonhosted.org/packages/e6/7c/911928d0f02d7934c3dfb9b58fa9192ab8a7e15724f847fb52e752f147ca/gfm_toc-0.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "05ea32a7d4f215be1acf27e7444b6497", "sha256": "c7890cf818e1b7d5bb4e25cafbe06a3a989d1d5f2a10d527c7fdc8a47c23b60a" }, "downloads": -1, "filename": "gfm-toc-0.0.5.tar.gz", "has_sig": false, "md5_digest": "05ea32a7d4f215be1acf27e7444b6497", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5999, "upload_time": "2019-03-26T02:59:22", "url": "https://files.pythonhosted.org/packages/dd/16/1531a1f696604a71a4d1469ba3f0eefa217204922930a2e1f90160692e52/gfm-toc-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "ea3acdcb06069bb369c830a35ac7f7d3", "sha256": "1d9bc9ecabe760e17798001cfd1c0b5548502564f8ab9969ecc518e597343ba8" }, "downloads": -1, "filename": "gfm_toc-0.0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "ea3acdcb06069bb369c830a35ac7f7d3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6780, "upload_time": "2019-04-03T01:34:23", "url": "https://files.pythonhosted.org/packages/eb/8d/84d6c285820d049646166343d4811031d5ae23367f72e72a28055dd495c6/gfm_toc-0.0.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f453d2a2fb0580520b77790809b15f48", "sha256": "f5894817f02e14b0783576e3bc7ab6105882da0a693482d6c6b802270531ca0f" }, "downloads": -1, "filename": "gfm-toc-0.0.6.tar.gz", "has_sig": false, "md5_digest": "f453d2a2fb0580520b77790809b15f48", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6027, "upload_time": "2019-04-03T01:34:24", "url": "https://files.pythonhosted.org/packages/0d/27/bfa4a335df25e7a604be523c437c60ef78cd56498f4221e04ee39428ae18/gfm-toc-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "19b36ef699e814a6b09dedf6572916aa", "sha256": "247af7267a6cbbdd4213f8383157997bcb07e39e819db737bd2dbfbdb94ee7ae" }, "downloads": -1, "filename": "gfm_toc-0.0.7-py3-none-any.whl", "has_sig": false, "md5_digest": "19b36ef699e814a6b09dedf6572916aa", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6781, "upload_time": "2019-04-07T07:56:56", "url": "https://files.pythonhosted.org/packages/5d/93/5af84cd3a2f818d5a68d154796b0e6a25cd490b82ee26071d6d43d883dc8/gfm_toc-0.0.7-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "256095f0c61268f656031af0f448fdd8", "sha256": "c53ed0e2cd400e89051377017ca98c11c9cef628b2effddf787db4fc19ff343d" }, "downloads": -1, "filename": "gfm-toc-0.0.7.tar.gz", "has_sig": false, "md5_digest": "256095f0c61268f656031af0f448fdd8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6018, "upload_time": "2019-04-07T07:56:58", "url": "https://files.pythonhosted.org/packages/c9/11/ebcf4b0f261f886d06ba81c6055fad17eb64ba259f2d20e259b67913b7f1/gfm-toc-0.0.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "19b36ef699e814a6b09dedf6572916aa", "sha256": "247af7267a6cbbdd4213f8383157997bcb07e39e819db737bd2dbfbdb94ee7ae" }, "downloads": -1, "filename": "gfm_toc-0.0.7-py3-none-any.whl", "has_sig": false, "md5_digest": "19b36ef699e814a6b09dedf6572916aa", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6781, "upload_time": "2019-04-07T07:56:56", "url": "https://files.pythonhosted.org/packages/5d/93/5af84cd3a2f818d5a68d154796b0e6a25cd490b82ee26071d6d43d883dc8/gfm_toc-0.0.7-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "256095f0c61268f656031af0f448fdd8", "sha256": "c53ed0e2cd400e89051377017ca98c11c9cef628b2effddf787db4fc19ff343d" }, "downloads": -1, "filename": "gfm-toc-0.0.7.tar.gz", "has_sig": false, "md5_digest": "256095f0c61268f656031af0f448fdd8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6018, "upload_time": "2019-04-07T07:56:58", "url": "https://files.pythonhosted.org/packages/c9/11/ebcf4b0f261f886d06ba81c6055fad17eb64ba259f2d20e259b67913b7f1/gfm-toc-0.0.7.tar.gz" } ] }