All Projects → lelinhtinh → jEpub

lelinhtinh / jEpub

Licence: ISC license
Simple EPUB builder library, works in modern browsers.

Programming Languages

EJS
674 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to jEpub

rePocketable
Tool to fetch articles from (getPocket|the web) and turn them into epub
Stars: ✭ 49 (+48.48%)
Mutual labels:  epub, epub-generation
Calibre
The official source code repository for the calibre ebook manager
Stars: ✭ 11,221 (+33903.03%)
Mutual labels:  epub, epub-generation
mkepub
Simple minimalistic library for creating EPUB3 files
Stars: ✭ 68 (+106.06%)
Mutual labels:  epub, epub-generation
novelsave
This is a tool to download and convert novels from popular sites to e-books.
Stars: ✭ 25 (-24.24%)
Mutual labels:  epub
infinite-electron
An Electron-based cross-platform desktop reader for free ebooks
Stars: ✭ 39 (+18.18%)
Mutual labels:  epub
kaf-cli
把txt文本转成epub和mobi电子书的命令行工具(原TmdTextEpub)
Stars: ✭ 133 (+303.03%)
Mutual labels:  epub
readiator
a cross-platform epub reader app
Stars: ✭ 30 (-9.09%)
Mutual labels:  epub
dslibris
An ebook reader for the Nintendo DS, DS Lite, and DSi.
Stars: ✭ 31 (-6.06%)
Mutual labels:  epub
fimfic2epub
📚 Chrome/Firefox extension & npm package for improved EPUB export on fimfiction.net
Stars: ✭ 17 (-48.48%)
Mutual labels:  epub
wattpad-downloader
A website to convert and download Wattpad stories into e-book reader formats.
Stars: ✭ 55 (+66.67%)
Mutual labels:  epub
bash-pubkit
Book template and EPUB compiler
Stars: ✭ 27 (-18.18%)
Mutual labels:  epub
calibre-kindle-comics
A calibre plugin that converts your comics into a readable format for kindle.
Stars: ✭ 32 (-3.03%)
Mutual labels:  epub
epub3guide
台灣 EPUB3 制作指引
Stars: ✭ 95 (+187.88%)
Mutual labels:  epub
react-viewer
Online EPUB/Comics viewer
Stars: ✭ 52 (+57.58%)
Mutual labels:  epub
SDKLauncher-OSX
A small OS X application to serve as a launcher/testbed for the Readium SDK on the Mac.
Stars: ✭ 21 (-36.36%)
Mutual labels:  epub
scopy
Python script for searching through your digital books and cataloguing them in an easy-to-share list of files.
Stars: ✭ 28 (-15.15%)
Mutual labels:  epub
epub-parser
A powerful yet easy-to-use epub parser
Stars: ✭ 103 (+212.12%)
Mutual labels:  epub
SDKLauncher-Android
Launcher app for Readium SDK on Android
Stars: ✭ 77 (+133.33%)
Mutual labels:  epub
bitcoin-development-with-go
[Work in Progress] A little book on Bitcoin Development with Go (golang)
Stars: ✭ 19 (-42.42%)
Mutual labels:  epub
InMangaKindle
Descarga manga en español en diferentes formatos (PNG, PDF, EPUB, MOBI)
Stars: ✭ 43 (+30.3%)
Mutual labels:  epub

jEpub

npm version FOSSA Status

Simple EPUB builder library, works in modern browsers.

Demo

  1. /demo
  2. jsfiddle.net/rhov44gg

Installation

npm install --save jepub

You can also use it via a CDN:

<script src="https://unpkg.com/jepub/dist/jepub.min.js"></script>

or:

<script src="https://cdn.jsdelivr.net/npm/jepub/dist/jepub.min.js"></script>

Dependencies

jEpub requires JSZip and EJS. Make sure these libraries are loaded before starting your code.

<script src="jszip.js"></script>
<script src="ejs.js"></script>
<script src="jepub.js"></script>
<script>
    const jepub = new jEpub()
    // jepub.init({
    // do something
</script>

Usage

const jepub = new jEpub()
jepub.init({
    i18n: 'en', // Internationalization
    title: 'Book title',
    author: 'Book author',
    publisher: 'Book publisher',
    description: '<b>Book</b> description', // optional
    tags: [ 'epub', 'tag' ] // optional
})
  • i18n only include the language codes defined in i18n.json
  • description: HTML string.
  • tags: Array.

Set published date

jepub.date(date: object)
  • date: Date Object.

Set identifier

jepub.uuid(id: string | number)
  • id: Unique id.

Add cover

jepub.cover(data: object)
  • data: A Blob or an ArrayBuffer object from XMLHttpRequest.

Add notes

jepub.notes(content: string)
  • content: HTML string.

Add chapter *

jepub.add(title: string, content: string | array, index?:number)
  • title: Plain text.
  • content:
    • string: HTML string.
    • array: Plain text for each item.
  • index: Item index.

Add image

jepub.image(data: object, IMG_ID: string)
  • data: A Blob or an ArrayBuffer object from XMLHttpRequest.
  • IMG_ID: Unique id.

Place <%= image[IMG_ID] %> inside the chapter's content (HTML string only), where you want to display it.

Generate EPUB *

jepub.generate(type = 'blob', onUpdate?: metadata => void)

Static methods +

Convert HTML to text

jEpub.html2text(html: string, noBr = false)
  • html: HTML string.
  • noBr: Boolean. Add line break after Block-level elements.

Development

npm start

Builds are concatenated and minified using Webpack and Babel.

npm run build

License

ISC. Copyright 2018 lelinhtinh

FOSSA Status

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].