core-okf
@equationalapplications/core-okf · npm · source
Low-level, database-agnostic building blocks for OKF.
To convert a wiki to and from OKF directly, use formatOkfBundle and parseOkfBundle from core
instead. See the OKF guide.
npm install @equationalapplications/core-okf| Function | Purpose |
|---|---|
serializeFrontmatter(obj) / parseFrontmatter(text) |
YAML frontmatter, including flow mappings and sequences |
buildConceptDocument(fm, body) / parseConcept(text) |
Build or split one concept file |
buildIndexMd(sections) / buildRootIndexMd(version, sections) |
Directory and root indexes |
buildLogMd(entries) / parseLogMd(text) |
Append-only chronological logs |
extractMarkdownLinks(text) |
Relative links → { text, path } (graph edges) |
deriveEventId(input) |
Deterministic id for a log line with no id comment (profile §7) |
createEventIdDeriver(input) |
The same id at many occurrences: returns (occurrence) => id, hashing the summary once |
const md = buildConceptDocument({ type: 'task', id: 'task_1' }, '# Buy groceries');const { frontmatter, body } = parseConcept(md);Conformance fixtures are in packages/okf/fixtures, and the profile spec is in
docs/okf-profile.md.