Code Monkey home page Code Monkey logo

bretzel's Introduction

Bretzel

Convert an ordered collection of markdown files into a PDF.

Ideal to easily generate books or slides.

Usage

Create a directory containing .md files with exactly 3 leading numbers :

  • book/001 Great introduction.md
  • book/002 Fantastic story.md
  • book/003 Tragic ending.md

Then run gulp --src book

And magic! You get a nice book.pdf

Tree variants

You can have holes in the ordering, the header counter is adjusted for you at rendering time :

  • book/001 Great introduction.md
  • book/042 Fantastic story.md
  • book/210 Epilogue.md
  • book/211 Tragic ending.md

Subdirectories let you regroup similar pages by topic :

  • book/01 - Middle Ages/001 Huge Battle.md
  • book/01 - Middle Ages/003 Tall Castle.md
  • book/02 - Victorian Times/001 Steam Machine.md
  • book/02 - Victorian Times/345 Magic Train.md

When unsure about the ouput result, look at the feedback given on stdout.

Add a title in the header of each pages

DOC_TITLE="My wonderful title" gulp --src book

See system.env.DOC_TITLE inside runnings.js

Options

  • Format
    • landscape : --orientation=landscape
    • portrait (default) : --orientation=portrait
  • Disable automatic title
    • --no-auto-h1
    • Note : in this case you need to add H1 tags on each page.

Markdown support

  • Github Flavored Markdown is used for syntax highlighting.
  • Intentional page-break are triggered by adding …/… or .../... to the document.

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.