Socket
Book a DemoInstallSign in
Socket

pandoc-index

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pandoc-index

Create a book index with pandoc

latest
Source
npmnpm
Version
0.3.0
Version published
Maintainers
1
Created
Source

About

Create an index for markdown/pandoc books.

I wrote a technical book in markdown and needed a possibility to create an index of important terms. I did not find something usable for me (did not want to install the whole LaTeX suite just to create an index). So I wrote this rather quick and dirty tool. There are probably better ways. YMMV.

Install

npm install -g pandoc-index

Usage

  • Mark up all interesting terms with the index class, such as: This is an interesting [term]{.index} to add to the index.

  • Create a JSON representation of Pandoc's AST tree: pandoc -o myindex.json part1.md part2.md part3.md. This will output a file myindex.json.

  • Create the index: pandoc-index myindex. This will read myindex.json and output myindex.md

  • Create the book: pandoc -o mybook.epub -t epub3 part1.md part2.md part3.md myindex.md.

Note

Some of the code is adapted from pandoc-filter. pandoc-index is, however, not a pandoc filter since we don't change the original text at all.

Credits

Thanks to John MacFarlane for pandoc and to Mike Henderson für pandoc-filter.

License

Apache 2.0

Keywords

pandoc

FAQs

Package last updated on 06 Jul 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.