From 45b30942475c090e8af4c279b0570ec19b79c34a Mon Sep 17 00:00:00 2001 From: Talha Mansoor Date: Thu, 21 Mar 2013 03:38:11 +0500 Subject: [PATCH] Adds Extract table of contents plugin --- extract_toc/README.md | 66 ++++++++++++++++++++++++++++++++++++++ extract_toc/__init__.py | 1 + extract_toc/extract_toc.py | 32 ++++++++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 extract_toc/README.md create mode 100644 extract_toc/__init__.py create mode 100644 extract_toc/extract_toc.py diff --git a/extract_toc/README.md b/extract_toc/README.md new file mode 100644 index 0000000..2cd826a --- /dev/null +++ b/extract_toc/README.md @@ -0,0 +1,66 @@ +Extract Table of Content +======================== + +A Pelican plugin to extract table of contents (ToC) from `article.content` and +place it in its own `article.toc` variable. + +Copyright (c) Talha Mansoor + +Author | Talha Mansoor +----------------|----- +Author Email | talha131@gmail.com +Author Homepage | http://onCrashReboot.com +Github Account | https://github.com/talha131 + +Acknowledgement +--------------- + +Thanks to [Avaris](https://github.com/avaris) for going out of the way to help +me fix Unicode issues and doing a thorough code review. + +Why do you need it? +=================== + +Pelican can generate ToC of reST and Markdown files, using markup's respective +directive and extension. ToC is generated and placed at the beginning of +`article.content`. You cannot place the ToC in `