Class: Coradoc::CoreModel::OutputArtifact

Inherits:
Base
  • Object
show all
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

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_documentDocumentElement?

Returns canonical CoreModel document.

Returns:



39
# File 'lib/coradoc/core_model/output_artifact.rb', line 39

attribute :core_document, DocumentElement

#frontmatter_blockFrontmatterBlock?

Returns parsed YAML frontmatter.

Returns:



35
# File 'lib/coradoc/core_model/output_artifact.rb', line 35

attribute :frontmatter_block, FrontmatterBlock

#output_keyString?

Returns site-relative key with no leading slash and no trailing extension. SSGs map this to their URL space.

Returns:

  • (String, nil)

    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