Class: Coradoc::Html::ReferenceMaterializers::Link
- Inherits:
-
Reference::Materializer::Base
- Object
- Reference::Materializer::Base
- Coradoc::Html::ReferenceMaterializers::Link
- Defined in:
- lib/coradoc/html/reference_materializers/link.rb
Overview
Render a hyperlink edge as a LinkElement with the URL as target. The catalog is not consulted — links are external by definition.
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.format ⇒ Object
18 19 20 |
# File 'lib/coradoc/html/reference_materializers/link.rb', line 18 def format :html end |
.kind ⇒ Object
10 11 12 |
# File 'lib/coradoc/html/reference_materializers/link.rb', line 10 def kind :link end |
.presentation ⇒ Object
14 15 16 |
# File 'lib/coradoc/html/reference_materializers/link.rb', line 14 def presentation :any end |
Instance Method Details
#materialize(edge:) ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/coradoc/html/reference_materializers/link.rb', line 23 def materialize(edge:, **) text = display_text(edge) Coradoc::CoreModel::LinkElement.new( target: edge.address.to_s, content: text, children: [ Coradoc::CoreModel::TextElement.new(content: text) ] ) end |