@ chalk-format/core (中文(简体) )
这个 .chalk 交互式图书格式 用于 JavaScript 和 TypeScript: 数据模型,读取和写入 .chalk
文档、资产密钥和商店、媒体库和运行中的实验室.
A 类 .chalk 书是页面(制成的 PDF 页面、图像或颜色),上面放有对象:墨水、文字、图像、,
视频,声音,3D模型和实验室,有文本层进行搜索. 媒体由从它的字节所制作的密钥来命名.
npm i @chalk-format/core
import { unpackLesson, packLesson, assetKey, registryLibrary } from '@chalk-format/core';
const { lesson, assets } = await unpackLesson(bytes); // open a .chalk
console.log(lesson.title, lesson.pages.length);
const again = await packLesson(lesson, assets); // write it back
const key = await assetKey(videoBytes); // 'c1:…', the same for the same bytes everywhere
const library = registryLibrary({ url: 'https://library.example.org' });
const found = await library.search({ q: 'pendulum', types: ['video/*'] });
实验室跟读者谈话 @chalk-format/core/lab/client数字 :
import { connectLab } from '@chalk-format/core/lab/client';
const lab = await connectLab({ id: 'org.example.pendulum', version: '1.0.0' });
相关软件包 : @chalk-format/reader (反应读者和编辑),
@chalk-format/pdf (中文(简体) ) .chalk, (中文(简体) ),
@chalk-format/library-server (运行媒体库).
规格、指南和来源: https://github.com/runagent-dev/calk-format (中文(简体) ). Apache -2.0 (英语).