Class: Marko::Renderers::Artifact
- Defined in:
- lib/marko/renderers/artifact.rb
Overview
Artifact renderer
Constant Summary
Constants inherited from Renderer
Instance Method Summary collapse
-
#initialize ⇒ Artifact
constructor
A new instance of Artifact.
- #render(topic) ⇒ Object
Constructor Details
#initialize ⇒ Artifact
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
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" |