Class: Coradoc::CoreModel::SourceBlock

Inherits:
Block
  • Object
show all
Defined in:
lib/coradoc/core_model/source_block.rb

Overview

Specialized block for source code listings

Represents a source code block with optional language annotation. This is a first-class model type rather than a generic Block with a delimiter_type tag.

Examples:

Creating a source code block

block = CoreModel::SourceBlock.new(
  content: "puts 'Hello, World!'",
  language: "ruby"
)

Instance Attribute Summary

Attributes inherited from Block

#block_semantic_type, #content, #delimiter_length, #delimiter_type, #element_type, #language, #lines

Attributes inherited from Base

#element_attributes, #id, #metadata_entries, #title

Class Method Summary collapse

Methods inherited from Block

#resolve_semantic_type

Methods included from ChildrenContent

#children=, #flat_text, included, #initialize, #renderable_content, #to_hash

Methods inherited from Base

#accept, #attr, #metadata, #semantically_equivalent?, #set_attr, #set_metadata

Class Method Details

.semantic_typeObject



17
# File 'lib/coradoc/core_model/source_block.rb', line 17

def self.semantic_type = :source_code