var full_comment: String is lazy do return content.join("\n").html_escape
# Synopsys in a template
- var tpl_short_comment: Streamable is lazy do
+ var tpl_short_comment: Writable is lazy do
var res = new Template
var syn = nitdoc_inline_processor.process(content.first)
res.add "<span class=\"synopsys nitdoc\">{syn}</span>"
end
# Full comment in a template
- var tpl_comment: Streamable is lazy do
+ var tpl_comment: Writable is lazy do
var res = new Template
var lines = content.to_a
res.add "<div class=\"nitdoc\">"
end
v.add "<pre class=\"nitcode\"><code>"
var hl = new HighlightVisitor
+ hl.line_id_prefix = ""
hl.enter_visit(ast)
v.add(hl.html)
v.add "</code></pre>\n"
else
v.add "<code class=\"nitcode\">"
var hl = new HighlightVisitor
+ hl.line_id_prefix = ""
hl.enter_visit(ast)
v.add(hl.html)
end
end
end
+# Decorator for span elements.
+#
+# Because inline comments can appear as span elements,
+# InlineDecorator do not decorate things like paragraphs or headers.
private class InlineDecorator
super NitdocDecorator
v.emit_in block
end
+ redef fun add_headline(v, block) do
+ v.emit_in block
+ end
+
redef fun add_code(v, block) do
# Try to parse code
var ast = toolcontext.parse_something(block.block.text.to_s)