Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

apocalism-js

andrey-p35MIT0.5.5

Automate your illustrated short story build process

markdown, pdf, book

readme

Apocalism.js

Automate your short story build process

Build Status

What is this?

This is an app I've been working on to compile my illustrated short stories. This is a very early version with a number of problems but I've already used it in production - the results can be seen at http://apocalism.co.uk.

It is essentially a beefed-up opinionated Markdown to HTML to PDF generator with pagination, image management and custom styling capabilities. You supply a Markdown file and high-res images and you get a print-ready PDF, bleeds and everything. You can also build an HTML-only paginated version if you want, too.

apocalism.js built on NodeJS and uses PhantomJS internally to render PDFs.

Who is this for?

It is meant for self publishing writers who:

  • want to work on the content and style of their writing at the same time (but within separate files)
  • want an unobtrusive writing format (Markdown with a few extra bits and bobs)
  • want a styling method that is powerful, popular and easy to pick up (Sass/CSS)
  • want to work in a text editor of their choice
  • are comfortable working with a command line interface

(At least one of those is known to exist at the time of writing.)

Requirements

  • NodeJS (tested on v0.10.22)
  • pdftk
  • graphicsmagick
  • pdfinfo (for local tests only - your distro might have this already)

Installation

npm install -g apocalism-js

Usage

Check out the example in example/. Run the example by doing either make example or, if you've installed using npm -g use apocalism example/example.md.

Loads of useful info in the wiki.

But... why?

I've written up a blog post about how and why I wrote this tool.

changelog

0.5.5

  • updated dependencies
  • switched to markdown-it for markdown parsing

0.5.4

  • updated dependencies
  • added Travis CI integration

0.5.3

0.5.2

  • temporary fix for #34

0.5.1

  • unbroke previous release (oops)

0.5.0

  • specified when an empty section does not generate an empty page as mentioned here (potentially breaking some styles)
  • fixed incorrect shebang for the executable (issue here)

0.4.4

  • minor performance increase for PDF generation

0.4.3

  • added output format to page classes

0.4.2

  • updated to latest version of ectoplasm (contains bugfixes, slightly different API)

0.4.1

  • added --no-images flag
  • added block-level style hooks for lists

0.4.0

Massive massive rewrite!

  • updated all dependencies
  • moved all code that deals with modifying the text into a separate folder of single-purpose modules (see the formatters folder)
  • moved all code that outputs stuff to the output folder into a series of single-purpose modules (see the outputters folder)
  • generally cleaned up, streamlined and made everything loads more modular
  • streamlined CLI
  • switched to using ectoplasm for handling PhantomJS scripts
  • made sure everything is true async to avoid unleashing Zalgo

0.3.14

  • updated phantomjs NPM module dependency to avoid this bug

0.3.13

  • merged in pull request #23, changing to he for html entity encoding
  • added a couple of mixins for common tasks (see #20)
  • added removing of empty <p> tags inside phantom-wrapper (see #22)

0.3.12

  • temporarily set json2sass dependency to point to the specific Github commit

0.3.11

  • fixed issue with page breaking after an image, when it's followed by text

0.3.10

  • added example project and some extra bits in the readme
  • updated binary name to just apocalism
  • fixed problem with --ignore-blank not working properly

0.3.9

  • fixed issue with weird missing dot (see #19)
  • some improvements to error and status reporting from within the phantom processes
  • fixed style issue with line that should have zero indentation immediately after an <hr> tag
  • some cleaning out (moved jslint cruft into a jslintrc file, removed long-stack-traces)

0.3.8

  • --debug pages are now output with utf-8 encoding
  • css is output compressed
  • updated dependencies

0.3.7

  • changed the way dropcaps work (they are now given the cap class)
  • added support for hanging quotation marks (see #14)

0.3.6

  • refactored book.js and improved test coverage
  • improved the way empty sections are handled (see #15)
  • added an --ignore-blank option to the command line

0.3.5

  • refactored the way phantomjs is used as a dependency (making it easier to manage the version currently in use), fixes #13
  • switched to websockets for everything phantomjs-related, gaining a huge performance boost #7

0.3.4

  • fixed crash with null section contents
  • fixed #10

0.3.3

  • added support for jpg image formats (issue #5)
  • added dpi settings in options
  • some refactoring for reader
  • improved test coverage

0.3.2

  • fixed #9

0.3.0

  • it is now possible to update options through a manifest (story.json inside the project folder)
  • added custom styling syntax

0.2.2

  • added this changelog
  • removed caching feature
  • added --debug flag for the CLI