npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bookly2

v2.0.2

Published

Create books or documents in different formats with pandoc and node using markdown

Downloads

6

Readme

Bookly

A simple command-line tool for generating ebooks or documents in different formats. It uses pandoc behind the scense to conver the documents

Requirements

  • node > 0.12.0 (you use nvm to manage your node versions)

  • pandoc

  • Amazon KindleGen

  • python (for some pandoc filters)

  • phantomjs (for making pdfs from html chapters)

    # Windows (MSVC 2013), 64-bit, for Windows Vista or later, bundles VC++ Runtime 2013
    $ curl -L http://astefanutti.github.io/decktape/downloads/phantomjs-msvc2013-win64.exe -o bin\phantomjs.exe
    # Mac OS X (Cocoa), 64-bit, for OS X 10.6 or later
    $ curl -L http://astefanutti.github.io/decktape/downloads/phantomjs-osx-cocoa-x86-64 -o bin/phantomjs
    # Linux (CentOS 6), 64-bit
    $ curl -L http://astefanutti.github.io/decktape/downloads/phantomjs-linux-centos6-x86-64 -o bin/phantomjs
    # Linux (CentOS 7), 64-bit
    $ curl -L http://astefanutti.github.io/decktape/downloads/phantomjs-linux-centos7-x86-64 -o bin/phantomjs
    # Linux (Debian 8), 64-bit
    $ curl -L http://astefanutti.github.io/decktape/downloads/phantomjs-linux-debian8-x86-64 -o bin/phantomjs
  • latex (for building pdf)

Getting Started

  • Install with npm i bookly2 -g
  • Create a new project with bookly2 new docname
  • Go to your book folder: cd docname
  • Update the book name in ./config.js if you need to.
  • Update book.txt
  • Start writing the book (or your document) in the chapters folder.

Then you can use the following commands to the build the book:

Build Each Chapter

  • Build the chapters only: bookly2 build -e
  • Convert each html chapter to pdf: bookly2 build -e && bookly2 build -r

Build the Book

  • Build the book in all formats: bookly2 build -a

  • Build the book in give formats:

      bookly2 build -f 'format1, format2, ...'

    possible formats are: pdf, html, epub, mobi, md, docx, tex

    For example, the following converts the book in pdf and html

      bookly2 build -f 'pdf, html'

Creating manuscript

You can use the concat command to concatenate all the files in the input folder and create a manuscript folder. For example:

input/ch1/ch1.md, input/ch1/ch1-1.md` outputs `manuscript/ch1/ch1.md

You can use the -m flag to specify a name for the manuscript folder:

bookly2 concat -m 'foldername'

Options

Most of the options are used with the build command. Below is the full list of all options:

  • -c (--config): Specifies the name of the config file in the root of the project.

  • -e (--chapters-only): Only converts each chapter to html: bookly2 build -e

  • -r (--render): Render html chapters with phantom: bookly2 build -r

    Renders each chapter in pdf. Only after each chapter is created with the e or a flag:, i.e.

      bookly2 build -e
  • -p (--patterns): List of read file patterns, eg:

      bookly2 build -f 'html' -p '**/*.markdown'

    The -p defines a list of pattern(s) that overrides the default pattern (**/*.md). Multiple patterns can be passed in:

      bookly2 -p '*.md, **/*.md'

    Note: That pattern should exist, otherwise Pandoc will throw an error.

  • -f (--formats): Specifies book output formats. Possible options are: pdf, epub, html, mobi, md, docx, tex. Multiple formats can be given as a list:

      bookly2 build -f 'html, epub, pdf'
  • -a (--all): Converts the book to all formats:

      bookly2 build -a

    This will convert each chapter to html. In addition, it will convert the book to pdf, html, epub, mobi, md, docx, and tex formats.

  • -n (--version-number): Version number value for the book:

      bookly2 build -f 'pdf' -n 'v0.0.1'
  • -m (--manuscript): Used with the concat command: folder name for the manuscript:

      bookly2 concat -m 'mymanuscript'