@bookbox/core
v0.3.1
Published
Bookbox — e-book format
Downloads
171
Readme
@bookbox/core
npm i @bookbox/core
API
import {createBook} from '@bookbox/core';
const {
tokens, // array of tokens for view
meta, // meta info: contents, media
store, // store of elements and tokens
} = createBook({
builder, // builder for view (html, markdown, ...)
externalBuilder, // optional, for extensions
schema, // ast tree from generator or raw tree from json/yaml
resourceOptions, // optional, for custom resource paths
});
Elements
import type {BookElements} from '@bookbox/core';
type AllElementNames = keyof BookElements;
// -> "title" | "authors" | "header" | "strong" | "em" | "code" | ...
type CodePropNames = keyof BookElements['code']['props'];
// -> "lang" | "block" | "inline" | "position" | "key" | "meta"