OkfDocument class final

An Open Knowledge Format document: YAML frontmatter and a Markdown body.

Constructors

OkfDocument({Map<String, Object?> frontmatter = const <String, Object?>{}, String body = '', bool hasFrontmatter = true})
Creates a document.
OkfDocument.parse(String source, {String? sourcePath})
Parses an OKF document.
factory

Properties

body String
Markdown following the frontmatter block.
final
citations List<OkfLegacyCitation>
Alias for legacyCitations.
no setter
description String?
Optional one-line summary.
no setter
frontmatter Map<String, Object?>
Ordered, open YAML metadata. Unknown keys are retained.
final
hasFrontmatter bool
Whether parsing found a frontmatter block.
final
hashCode int
The hash code for this object.
no setterinherited
hasLegacyCitations bool
Whether a legacy v0.1 citation entry is present.
no setter
legacyCitations List<OkfLegacyCitation>
Entries from a legacy v0.1 top-level # Citations section.
no setter
metadata OkfMetadata
Typed, non-destructive access to known OKF metadata.
no setter
resource String?
Optional URI for the underlying asset.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
status OkfLifecycleStatus
Lifecycle status, defaulting to stable.
no setter
tags List<String>
Cross-cutting category tags.
no setter
title String?
Optional human-readable display name.
no setter
trustTier OkfTrustTier
Trust tier derived from the normalized verification events.
no setter
type String?
Required OKF concept type, when represented by a scalar.
no setter

Methods

copyWith({Map<String, Object?>? frontmatter, String? body, bool? hasFrontmatter}) OkfDocument
Returns a copy with selected document parts replaced.
isStale([DateTime? today]) bool
Whether the document is stale on today.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
serialize({OkfYamlEmitter emitter = const OkfYamlEmitter()}) String
Serializes the document in canonical form.
toMarkdown({OkfYamlEmitter emitter = const OkfYamlEmitter()}) String
Alias for serialize.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited