nitc :: CmdDecorator
nitc :: CmdDecorator :: _model
Model used by wikilink commands to find entitiesnitc :: CmdDecorator :: defaultinit
nitc :: CmdDecorator :: filter=
Filter to apply if anynitc :: CmdDecorator :: model=
Model used by wikilink commands to find entitiesnitc :: CmdDecorator :: try_find_mentity
nitc $ CmdDecorator :: SELF
Type of this instance, automatically specialized in every classnitc $ CmdDecorator :: add_span_code
Render a code span reading from a buffer.nitc $ CmdDecorator :: add_wikilink
Renders a[[wikilink]]
item.
nitc :: NitdocDecorator :: _current_mdoc
The currently processed mdoc.markdown :: HTMLDecorator :: _headlines
nitc :: CmdDecorator :: _model
Model used by wikilink commands to find entitiesnitc :: NitdocDecorator :: _toolcontext
markdown :: Decorator :: add_blockquote
Render a blockquote.markdown :: Decorator :: add_headline
Render a headline block with corresponding level.markdown :: Decorator :: add_line_break
Render a line breakmarkdown :: Decorator :: add_listitem
Render a list item.markdown :: Decorator :: add_orderedlist
Render an ordered list.markdown :: Decorator :: add_paragraph
Render a paragraph block.markdown :: Decorator :: add_span_code
Render a code span reading from a buffer.markdown :: Decorator :: add_strike
Render a strike text.markdown :: Decorator :: add_strong
Render a strong text.markdown :: Decorator :: add_unorderedlist
Render an unordered list.markdown :: Decorator :: add_wikilink
Renders a[[wikilink]]
item.
markdown :: Decorator :: append_code
Render code text from buffer and escape it.markdown :: Decorator :: append_value
Render a text and escape it.core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: NitdocDecorator :: current_mdoc
The currently processed mdoc.nitc :: NitdocDecorator :: current_mdoc=
The currently processed mdoc.nitc :: CmdDecorator :: defaultinit
nitc :: NitdocDecorator :: defaultinit
markdown :: HTMLDecorator :: defaultinit
markdown :: Decorator :: defaultinit
core :: Object :: defaultinit
markdown :: Decorator :: escape_char
Render a character escape.nitc :: CmdDecorator :: filter=
Filter to apply if anymarkdown :: HTMLDecorator :: headlines=
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.
nitc :: CmdDecorator :: model=
Model used by wikilink commands to find entitiescore :: Object :: native_class_name
The class name of the object in CString format.core :: Object :: output_class_name
Display class name on stdout (debug only).nitc :: NitdocDecorator :: toolcontext
nitc :: NitdocDecorator :: toolcontext=
nitc :: CmdDecorator :: try_find_mentity
# Custom Markdown processor able to process doc commands
class CmdDecorator
super NitdocDecorator
redef type PROCESSOR: CmdMarkdownProcessor
# Model used by wikilink commands to find entities
var model: Model
# Filter to apply if any
var filter: nullable ModelFilter
redef fun add_span_code(v, buffer, from, to) do
var text = new FlatBuffer
buffer.read(text, from, to)
var name = text.write_to_string
name = name.replace("nullable ", "")
var mentity = try_find_mentity(name)
if mentity == null then
super
else
v.add "<code>"
v.emit_text mentity.html_link.write_to_string
v.add "</code>"
end
end
private fun try_find_mentity(text: String): nullable MEntity do
var mentity = model.mentity_by_full_name(text, filter)
if mentity != null then return mentity
var mentities = model.mentities_by_name(text, filter)
if mentities.is_empty then
return null
else if mentities.length > 1 then
# TODO smart resolve conflicts
end
return mentities.first
end
redef fun add_wikilink(v, token) do
v.render_wikilink(token, model)
end
end
src/doc/templates/html_commands.nit:361,1--404,3