GithubHelp home page GithubHelp logo

tocdoc's Introduction

TOCdoc

Make your long documents easy to read by adding a table of contents on the side. A lo-fi Gitbook alternative, using Pandoc and bash.

To use, just create three files, run ./tocdoc.sh, and open up generated/index.html to see your TOCdoc.

Check out the live example based on the default example document in document/.

Alternatives

TOCdoc is based on tools like:

TOCdoc does less. But it also requires less configuration.

Setup

First, install Pandoc.

Then, git clone https://github.com/nickloewen/tocdoc.

Or, if you want to clone into a folder with a better name:

$ mkdir philosophiae-naturalis-principia-mathematica
$ cd philosophiae-naturalis-principia-mathematica
$ git clone https://github.com/nickloewen/tocdoc .

Creating a webpage

  1. Create your document, and save it to document/body.md.
  2. Create your table of contents and save it to document/contents.md.
  3. In documents/title.txt, write the title you want displayed on the browser tab.
  4. Run ./tocdoc.sh.
  5. Check out the output at generated/index.html.

Editing body.md

  • Use Pandoc markdown
  • I recommend using an H1 for the overall page title, and H2s for chapter titles. A horizontal rule (markdown: ***) between chapters is nice, too.
  • Add anchor links to your headings like this: ## Chapter 2 {#ch-2}.
  • The current stylesheet assumes that your first H1 will be followed by a byline, a horizontal rule, and the first chapter, with no additional content.

Editing contents.md

  • You can use an H2 to add a title to your table of contents. (Other markdown will also work, it's just not covered by the stylesheet.).
  • Create your table of contents using a regular markdown list (bulleted lists, numbered lists, and automatically numbered lists wll all work).
  • Link to your headings like this: [Chapter 2](#ch-2)

Images and other assets

If you want to add other static assets (like images), you can put those straight into generated/.

tocdoc's People

Contributors

nickloewen avatar

Stargazers

Nirmal avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.