@kappan/core
v0.4.0
Published
Kappan core: Markdown to EPUB 3.3 pipeline, plugin runtime, theme & accessibility APIs
Readme
@kappan/core
Kappan のパイプライン本体。Markdown → mdast → hast → XHTML への変換、設定読み込み、プラグインライフサイクル、EPUBCheck 連携を提供する。
Installation
pnpm add @kappan/coreUsage
import { defineConfig, buildBook } from '@kappan/core';
const config = defineConfig({
metadata: { title: '私の本', creator: [{ name: '著者' }] },
source: { entry: 'src/index.md' },
theme: /* テーマ */,
});
await buildBook({ config, configDir: '/path/to/book', outputPath: 'out.epub' });書籍プロジェクトの作り方は本体リポジトリの docs/quickstart.md を、プラグインの書き方は docs/plugin-authoring.md を参照。
Exports
defineConfig(input):設定の型補完と zod 検証buildBook(opts):書籍全体のビルドbuildChapter(opts):単一章のビルド(preview server 等で利用)definePlugin(input):プラグインのファクトリ定義loadConfig(path):設定ファイルの動的読み込み- 各種型(
KappanConfig、PluginContext、Diagnostic等)
Documentation
License
MIT
