"
- return res
- end
+ protected fun do_highlight(first_token: Token, last_token: nullable Token) is abstract
end
-##
+# Text-based highlighter that use ANSI escape sequence for colors
+class AnsiHighlightVisitor
+ super AbstractHighlightVisitor
-# Model entity or whatever that can produce an infobox
-interface HInfoBoxable
- # An new infobox documenting the entity
- fun infobox(v: HighlightVisitor): HInfoBox is abstract
-end
+ # The produced highlighting
+ var result = new Template
-redef class MDoc
- # Append an entry for the doc in the given infobox
- fun fill_infobox(res: HInfoBox)
+ redef fun do_highlight(f, l)
do
- if content.length < 2 then
- res.new_field("doc").text(content.first)
- return
- end
- var c = res.new_dropdown("doc", content.first)
- for x in content.iterator.skip_head(1) do
- c.append x
- c.add_raw_html "