markdown2 $ ManRenderer :: SELF
Type of this instance, automatically specialized in every classcore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
markdown2 :: MdVisitor :: defaultinit
core :: Object :: defaultinit
markdown2 :: MdRenderer :: defaultinit
markdown2 :: ManRenderer :: defaultinit
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Object :: output_class_name
Display class name on stdout (debug only).
# Markdown document renderer to Manpage
class ManRenderer
super MdRenderer
# Output under construction
private var man: Buffer is noinit
# Render `node` as Markdown
redef fun render(node) do
man = new Buffer
enter_visit(node)
return man.write_to_string
end
redef fun visit(node) do node.render_man(self)
# Add `string` to `man`
fun add(string: String) do
man.append(string.replace("-", "\\-"))
end
# Add code that need to be escaped
fun add_code(code: String) do
add code.replace(" ", "\\ ")
end
# Add a blank line to the output
fun add_line do
add "\n"
end
end
lib/markdown2/markdown_man_rendering.nit:22,1--52,3