import model_utils
import modelize_property
+import markdown
# The NitdocContext contains all the knowledge used for doc generation
class NitdocContext
private var opt_custom_footer_text: OptionString = new OptionString("Text displayed as footer of all pages", "--custom-footer-text")
init do
- self.arguments = toolcontext.option_context.rest
- toolcontext.option_context.options.clear
toolcontext.option_context.add_option(opt_dir)
toolcontext.option_context.add_option(opt_source)
toolcontext.option_context.add_option(opt_sharedir)
toolcontext.option_context.add_option(opt_custom_overview_text)
toolcontext.option_context.add_option(opt_custom_menu_items)
toolcontext.process_options
+ self.arguments = toolcontext.option_context.rest
if arguments.length < 1 then
+ print "usage: nitdoc [options] file..."
toolcontext.option_context.usage
exit(1)
end
# comment
var nmodule = ctx.mbuilder.mmodule2nmodule[mmodule]
append("<section class='description'>")
- if not nmodule.full_comment.is_empty then append("<pre>{nmodule.full_comment}</pre>")
+ if not nmodule.full_comment.is_empty then append("<div>{nmodule.full_comment}</div>")
process_generate_dot
append("</section>")
# classes
# comment
var nclass = ctx.mbuilder.mclassdef2nclassdef[mclass.intro]
append("<section class='description'>")
- if nclass isa AStdClassdef and not nclass.full_comment.is_empty then append("<pre>{nclass.full_comment}</pre>")
+ if nclass isa AStdClassdef and not nclass.full_comment.is_empty then append("<div>{nclass.full_comment}</div>")
process_generate_dot
append("</section>")
# concerns
fun html_full_comment(page: NitdocPage) do
if page.ctx.mbuilder.mmodule2nmodule.has_key(self) then
page.append("<div id='description'>")
- page.append("<pre>{page.ctx.mbuilder.mmodule2nmodule[self].full_comment}</pre>")
+ page.append("<div>{page.ctx.mbuilder.mmodule2nmodule[self].full_comment}</div>")
page.append("</div>")
end
end
page.append("<p class='info inheritance'>")
page.append("<span class=\"noComment\">no comment for </span>")
else
- page.append("<pre>{nclass.full_comment}</pre>")
+ page.append("<div>{nclass.full_comment}</div>")
page.append("<p class='info inheritance'>")
end
if mclassdef.is_intro then
page.append("<p class='info inheritance'>")
page.append("<span class=\"noComment\">no comment for </span>")
else
- page.append("<pre>{intro_nprop.full_comment}</pre>")
+ page.append("<div>{intro_nprop.full_comment}</div>")
page.append("<p class='info inheritance'>")
end
page.append("introduction in ")
page.append("<p class='info inheritance'>")
page.append("<span class=\"noComment\">no comment for </span>")
else
- page.append("<pre>{nprop.full_comment}</pre>")
+ page.append("<div>{nprop.full_comment}</div>")
page.append("<p class='info inheritance'>")
end
if is_intro then
end
private fun full_comment: String do
- var res = new Buffer
if n_moduledecl != null and n_moduledecl.n_doc != null then
- for t in n_moduledecl.n_doc.n_comment do
- res.append(t.text.substring_from(1).html_escape)
- end
+ return n_moduledecl.n_doc.full_markdown.html
end
- return res.to_s
+ return ""
end
end
end
private fun full_comment: String do
- var res = new Buffer
- if n_doc != null then
- for t in n_doc.n_comment do res.append(t.text.substring_from(1).html_escape)
- end
- return res.to_s
+ if n_doc != null then return n_doc.full_markdown.html
+ return ""
end
end
end
private fun full_comment: String do
- var res = new Buffer
- if n_doc != null then
- for t in n_doc.n_comment do res.append(t.text.substring_from(1).html_escape)
- end
- return res.to_s
+ if n_doc != null then return n_doc.full_markdown.html
+ return ""
end
end