nitc :: CmdCode :: defaultinit
# Abstract command that returns source-code pieces
abstract class CmdCode
super DocCommand
autoinit(model, filter, node, format)
# AST node to display code from
var node: nullable ANode = null is optional, writable
# Rendering format
#
# Set the output format for this piece of code.
# Can be "raw", "html" or "ansi".
# Default is "raw".
#
# This format can be different than the format used in the command response.
# For example you can choose to render code as HTML inside a JSON object response.
# Another example is to render raw format to put into a HTML code tag.
var format = "raw" is optional, writable
# Render `node` depending on the selected `format`
fun render_code(node: ANode): Writable do
return node.location.text
end
end
src/doc/commands/commands_model.nit:417,1--441,3