Class: Marko::Renderers::Artifact

Inherits:
Renderer
  • Object
show all
Defined in:
lib/marko/renderers/artifact.rb

Overview

Artifact renderer

Constant Summary

Constants inherited from Renderer

Renderer::NL, Renderer::NN

Instance Method Summary collapse

Constructor Details

#initializeArtifact

Returns a new instance of Artifact.



8
9
10
# File 'lib/marko/renderers/artifact.rb', line 8

def initialize
  @topic = Topic.new
end

Instance Method Details

#render(topic) ⇒ Object

Parameters:



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/marko/renderers/artifact.rb', line 13

def render(topic)
  root = "    ---\n    \\% \#{topic.title}\n    \\% \#{topic[:author]}\n    \\% \#{Time.now.strftime('%Y-%b-%d')}          \n    ...\n  STR\n  \n  topic.to_a.drop(1)\n    .map{ @topic.render(it) }\n    .unshift(root)\n    .join(NN)\nend\n"