Simple server for EPUB generation
It takes the parameters in a query string, generates and returns an EPUB 3.4 instance to the caller.
The possible query parameters are
url The URL for the content respec Whether the source is in respec (true) or a final HTML (false). publishDate Publication date specStatus Specification type addSectionLinks Add section links with "§" maxTocLevel Max TOC level
The module is a wrapper around a standard node.js http.CreateServer
, and a call to the convert function.
Usage examples:
(In all examples, the URL for the server is set to https://epub.example.org
)
Convert the HTML file (as generated by ReSpec) to an EPUB 3.4 file. The generated publication's name is short-name.epub
, where short-name
is set in the ReSpec configuration:
https://epub.example.org?url=https://www.example.org/doc.html
Convert the HTML ReSpec source to an EPUB 3.4 file. The source is converted on-the-fly by respec:
https://epub.example.org?url=https://www.example.org/doc.html&respec=true
Convert the HTML ReSpec source to an EPUB 3.4 file, setting its spec status to REC. The source is converted on-the-fly by respec, overwriting the specStatus
entry in its configuration to REC
:
https://epub.example.org?url=https://www.example.org/doc.html&respec=true&specStatus=REC
Generates a collection, described by the configuration file. (See the separate module for more details on the configuration file.)
https://epub.example.org?url=https://www.example.org/collection.json
Usage
import * as mod from "serve";