Class: Coradoc::CoreModel::OutputArtifact
- Defined in:
- lib/coradoc/core_model/output_artifact.rb
Overview
Output-side state object for host-system emitters (VitePress, Hugo, Astro, plain ERB, etc.).
coradoc’s source side has IncludeResolver::Filesystem to resolve include targets without coupling to a storage layer. The output side has no analogous state object — until now. OutputArtifact captures the three pieces of state coradoc genuinely needs to hand to a downstream emitter:
-
output_key— site-relative key (e.g. “author/iso/ref/foo”) -
frontmatter_block— parsed YAML frontmatter (may be empty) -
core_document— the canonical CoreModel document
The consumer takes these and renders whatever wrapper it needs in its host system’s native template language. coradoc does not know about VitePress, ERB, or Liquid. Symmetric with the source side: minimal protocol object, not an engine.
A mirror-tree document is deliberately NOT bundled here. coradoc core has no runtime dependency on coradoc-mirror; consumers that target the mirror JSON pipeline pair an OutputArtifact with a separately-computed Coradoc::Mirror.transform(core) result.
Instance Attribute Summary collapse
-
#core_document ⇒ DocumentElement?
Canonical CoreModel document.
-
#frontmatter_block ⇒ FrontmatterBlock?
Parsed YAML frontmatter.
-
#output_key ⇒ String?
Site-relative key with no leading slash and no trailing extension.
Attributes inherited from Base
#element_attributes, #id, #metadata_entries, #title
Method Summary
Methods inherited from Base
#accept, #attr, #body_content?, build, #flat_text, #metadata, #semantically_equivalent?, #set_attr, #set_metadata, #whitespace_only?
Instance Attribute Details
#core_document ⇒ DocumentElement?
Returns canonical CoreModel document.
39 |
# File 'lib/coradoc/core_model/output_artifact.rb', line 39 attribute :core_document, DocumentElement |
#frontmatter_block ⇒ FrontmatterBlock?
Returns parsed YAML frontmatter.
35 |
# File 'lib/coradoc/core_model/output_artifact.rb', line 35 attribute :frontmatter_block, FrontmatterBlock |
#output_key ⇒ String?
Returns site-relative key with no leading slash and no trailing extension. SSGs map this to their URL space.
31 |
# File 'lib/coradoc/core_model/output_artifact.rb', line 31 attribute :output_key, :string |