Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
npm i -g bindup
A CLI for rendering markdown directories into epub files. This readme will be fleshed out further in time.
Read the full docs at
To properly configure your book for Bindup:
manuscript
folder~
symbol to the front of their titlesAn example of how your manuscript directory might look is:
manuscript
1~ Dedication.md
2~ Chapter 1.md
3~ Chapter 2.md
The number and ~
will be removed when the book is rendered to an epub.
It works the same for nested folders:
manuscript
1~ Dedication.md
2~ Chapter 1
(Folder)
1~ Section A.md
2~ Section B.md
3~ Chapter 2
(Folder)
1~ Part 1.md
2~ Part 2.md
You must customize settings for your book by creating a JSON file with valid properties.
Example book-config.json
:
{
"author": "Benjamin August",
"title": "Book 1: Welcome to the Multiverse",
"manuscript": "./myBookDirectory",
"formats": [
"epub"
]
}
Check the spec for a full list of valid properties.
Required properties:
"title"
- string
The title of the book"author"
- string | string[]
Author(s) of the book. Can be a single string or array of strings if multiple"formats"
- string[]
The formats to export your book to. Only "epub"
is a valid value for now. More formats potentially coming in the future"manuscript"
- string
The relative path to the manuscript
directory, where your book should be storedExamples of optional properties include:
"description"
- string
The description of the book"date"
- string
The publication date"lang"
- string
The book's language as an ISO language codeUse bindup render book_config_path_here
That will render an epub to the directory the command is being run from.
For example:
bindup render my-book-config.json
You can also use frontmatter within your markdown files to explicitly set options. Doing so allows you to overcome the limitations of what files can be named in Unix, Mac or Windows systems.
For example, say want to use periods in your chapter title:
"Chapter 1.5"
This would not be possible using just the file name because periods are not allowed in file names. Instead, you can add frontmatter to the top of the file where you specify the chapter:
---
title: Chapter 1.5
---
The title in the frontmatter overrides the filename title, meaning even if your file is called:
1~ Chapter 1-5.md
its title in your ebook will be "Chapter 1.5".
title
: string (optional, default Chapter [number])
Chapter titleauthor
: string | string[] (optional)
Chapter author, generates info below chapter titlecontent
: string
HTML String of the chapter content, image sources are downloadedexcludeFromToc
: boolean (optional, default false)
Don't list chapter in Table of ContentsbeforeToc
: boolean (optional, default false)
List chapter before Table of Contents headingfilename
: string (optional)
Custom name for chapter fileurl
: string (optional)
External link below chapter titleYou can use bindup in your Node.js projects
import { generateBook } from 'bindup';
export default async () => {
try {
const epub = await generateBook(configPath);
//generateBook returns a Buffer if successful, void if not.
// Do whatever you want with it from here. You can
// pass it directly to fs.writeFile for example
} catch (error) {
throw new Error(error)
}
}
FAQs
static ebook generator
The npm package bindup receives a total of 1 weekly downloads. As such, bindup popularity was classified as not popular.
We found that bindup demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.