Skip to content

metal3d/pantoc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Pantoc

Parse a table of content to build a splitted document in mardown. Nice tool for pandoc

Installation

Download released binary at on github.

Or use "go get -u":

$ go get -u github.com/metal3d/pantoc
$ pantoc -h

Usage

Usage of pantoc:
  -tocfile="toc.yaml": YAML file that describes table of contents

Yaml format

Create a yaml file inside your document tree. The Yaml file should define a list ! That means that you have to prefix document part with a "minus" sign.

Example

- Introduction: src/intro.md
- Title for chapter 2: src/part2.md #a only one file for that chapter
- Title for other part:
    - src/intro_part_3 # this will be included without title
    - Sub part: src/subpart1.md # title is "Sub part" and file is included
    - Sub part2: src/subpart2.md # as above

Each key becomes the title, each file path are appended after title.

You can now try to build your document:

pantoc

If you named your tocfile with a different name:

pantoc -tocfile=mytoc.yaml

The command should print the entire document to STDOUT (your terminal).

Use it with pandoc:

# if you have toc.yaml
pandoc <(pantoc) -o book.pdf

# with another file
pandoc <(pantoc -tocfile=mytoc.yaml) -o book.pdf

You may have the book.pdf file that respect you table of content and with included content.

About

Parse a table of content to build a splitted document in mardown. Nice tool for pandoc

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages