返回 BookField

BookField 套件格式

wbpkg

BookField 可以驗證、安裝並閱讀的 package

版本快照

workbook.toml
schema_version = 4
.wbpkg/manifest.json
schemaVersion = 5
reader_manifest.json
schemaVersion = 3
reader.rdoc
schemaVersion = 3
Reader SQLite schema
db_schema_version = 17

概要

BookField 可以驗證、安裝並閱讀的 package

一個 package 是一個 work 與一個 edition 的單一可安裝邊界。 manifest.json 是 BookField 在 import 前讀取的公開 contract。Legacy packageKind 與 presentation fields 不屬於目前的 package shape。

可安裝容器

一個 package 是一個 work 與一個 edition 的單一可安裝邊界。

Manifest v5

manifest.json 是 BookField 在 import 前讀取的公開 contract。Legacy packageKind 與 presentation fields 不屬於目前的 package shape。

ReaderDoc v3

ReaderDoc content 已為 import 準備好,因此 reader 在 runtime 不需要解析 EPUB、HTML 或 CSS。

導覽樹

navigationTree 決定 reader 的 entry point 和 package 層級目錄。

Locator 索引

當 canonical docs 或 schema files 變更時,先更新 source,再刷新此 public snapshot 與說明。

學習計畫

Authored study plans 只有 package 含有 schedule data 時才會寫入 manifest.json。

Package 結構

wbpkg 內的 canonical files

Package paths 是以 package root 為基準的 POSIX paths。Text packages 會在 reader/ 下放置 ReaderDoc files;只有 image、audio 或 video 的 packages 可省略 reader/。

.wbpkg
manifest.json
reader/{assetId}/reader_manifest.json
reader/{assetId}/reader.rdoc
images/{assetId}.{ext}
images/{assetId}-thumb.{ext}
media/{assetId}.{ext}
locator/{profileId}.json

Manifest contract

Manifest v5 定義 install contract

manifest.json 是 BookField 在 import 前讀取的公開 contract。Legacy packageKind 與 presentation fields 不屬於目前的 package shape。

packageId / packageVersion

manifest.json 是 BookField 在 import 前讀取的公開 contract。Legacy packageKind 與 presentation fields 不屬於目前的 package shape。

work / edition

一個 package 是一個 work 與一個 edition 的單一可安裝邊界。

assets

Package paths 是以 package root 為基準的 POSIX paths。Text packages 會在 reader/ 下放置 ReaderDoc files;只有 image、audio 或 video 的 packages 可省略 reader/。

navigationTree

navigationTree 決定 reader 的 entry point 和 package 層級目錄。

studyPlans

Authored study plans 只有 package 含有 schedule data 時才會寫入 manifest.json。

bindings

當 canonical docs 或 schema files 變更時,先更新 source,再刷新此 public snapshot 與說明。

Package 建立

將 production tooling 與公開 package 邊界分離

  1. 1

    準備 source content

    準備 source content、metadata、media,以及 authored schedules 或 references。

  2. 2

    產生 wbpkg

    產生含 manifest metadata、ReaderDoc content、media、navigation 與 locator files 的 installable package。

  3. 3

    分享前驗證

    在 distribution 前檢查 package structure 與 schema compatibility。

Reader import

BookField 在本機讀取 installed package

  1. 1

    驗證

    BookField 會檢查 package shape,並拒絕 unsupported 或 malformed packages。

  2. 2

    解包

    Supported package assets 會解開到 app-owned local storage。

  3. 3

    Import 到 SQLite

    ReaderDoc payloads、navigation、locator indexes、search records 與 schedules 會註冊供 offline use。

相容性

讓 packages 可預期的規則

  • 拒絕 legacy packageKind values.
  • 拒絕 legacy presentation fields.
  • 拒絕 non-canonical package paths.
  • 拒絕 malformed structured references.
  • 不要在 installable wbpkg 中包含 source EPUB files。

Canonical references

更新政策

此公開頁面是 implementation-facing overview,不是 canonical schema source。Canonical docs 與 schema files 隨 BookField source materials 管理。

Source docs 與 schema files

  • 00-spec-index.md

    此公開頁面是 implementation-facing overview,不是 canonical schema source。Canonical docs 與 schema files 隨 BookField source materials 管理。

  • 04-manifest-json-schema.md

    manifest.json 是 BookField 在 import 前讀取的公開 contract。Legacy packageKind 與 presentation fields 不屬於目前的 package shape。

  • 08-reader-app-design.md

    BookField 在本機讀取 installed package

  • schemas/manifest-v5.schema.json / readerdoc-v3.schema.json

    此公開頁面是 implementation-facing overview,不是 canonical schema source。Canonical docs 與 schema files 隨 BookField source materials 管理。

當 canonical docs 或 schema files 變更時,先更新 source,再刷新此 public snapshot 與說明。

規劃 BookField package distribution

返回 product overview,或討論 wbpkg distribution flow 是否符合你的 content model。