nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
modelize_property: use resolve_mtype_unchecked during build_signature
[nit.git]
/
src
/
doc
/
doc_down.nit
diff --git
a/src/doc/doc_down.nit
b/src/doc/doc_down.nit
index
c9db676
..
60ed50b
100644
(file)
--- a/
src/doc/doc_down.nit
+++ b/
src/doc/doc_down.nit
@@
-27,7
+27,7
@@
redef class MDoc
var full_comment: String is lazy do return content.join("\n").html_escape
# Synopsys in a template
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>"
var res = new Template
var syn = nitdoc_inline_processor.process(content.first)
res.add "<span class=\"synopsys nitdoc\">{syn}</span>"
@@
-36,7
+36,7
@@
redef class MDoc
end
# Full comment in a template
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\">"
var res = new Template
var lines = content.to_a
res.add "<div class=\"nitdoc\">"
@@
-93,6
+93,7
@@
private class NitdocDecorator
end
v.add "<pre class=\"nitcode\"><code>"
var hl = new HighlightVisitor
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"
hl.enter_visit(ast)
v.add(hl.html)
v.add "</code></pre>\n"
@@
-109,6
+110,7
@@
private class NitdocDecorator
else
v.add "<code class=\"nitcode\">"
var hl = new HighlightVisitor
else
v.add "<code class=\"nitcode\">"
var hl = new HighlightVisitor
+ hl.line_id_prefix = ""
hl.enter_visit(ast)
v.add(hl.html)
end
hl.enter_visit(ast)
v.add(hl.html)
end
@@
-141,6
+143,10
@@
private class NitdocDecorator
end
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
private class InlineDecorator
super NitdocDecorator
@@
-148,6
+154,10
@@
private class InlineDecorator
v.emit_in block
end
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)
redef fun add_code(v, block) do
# Try to parse code
var ast = toolcontext.parse_something(block.block.text.to_s)