- ")
+ add("
{custom_title}
\nModules
- ")
var modss = mainmod.mhe.greaters_and_self.to_a
sort(modss)
for mod in modss do
@@ -204,7 +216,6 @@ class DocContext
op.append("\}\n")
self.gen_dot(op.to_s, "dep", "Modules hierarchy")
add("
X-Git-Url: http://nitlanguage.org
diff --git a/src/nitdoc.nit b/src/nitdoc.nit
index edf64f2..50bd192 100644
--- a/src/nitdoc.nit
+++ b/src/nitdoc.nit
@@ -27,7 +27,8 @@ class DocContext
super AbstractCompiler
# Destination directory
readable writable var _dir: String = "doc"
-
+ # GitHub Repo name
+ var github_repo: nullable String = null
# Content of a generated file
var _stage_context: StageContext = new StageContext(null)
@@ -86,8 +87,12 @@ class DocContext
readable var _opt_private: OptionBool = new OptionBool("Generate the private API", "--private")
readable var _opt_nodot: OptionBool = new OptionBool("Do not generate graphes with graphviz", "--no-dot")
readable var _opt_sharedir: OptionString = new OptionString("Directory containing the nitdoc files", "--sharedir")
- readable var _opt_overview_text: OptionString = new OptionString("Text displayed as introduction of Overview page", "--overview-text")
- readable var _opt_footer_text: OptionString = new OptionString("Text displayed as footer of all pages", "--footer-text")
+
+ readable var _opt_custom_menu_items: OptionString = new OptionString("Items displayed in menu before the 'Overview' item (Each item must be enclosed in 'li' tags)", "--custom-menu-items")
+ readable var _opt_custom_title: OptionString = new OptionString("Title displayed in the top of the Overview page and as suffix of all page names", "--custom-title")
+ readable var _opt_custom_overview_text: OptionString = new OptionString("Text displayed as introduction of Overview page before the modules list", "--custom-overview-text")
+ readable var _opt_custom_footer_text: OptionString = new OptionString("Text displayed as footer of all pages", "--custom-footer-text")
+ readable var _opt_github_repo_name: OptionString = new OptionString("GitHub repo name, example: --github MyRepoName", "--github")
var sharedir: nullable String
fun public_only: Bool
@@ -162,23 +167,30 @@ class DocContext
"\n" +
""
- var action_bar = "
{doc.to_html}\n") + dctx.add("
{doc.to_html}\n") + dctx.add("\n") + dctx.add("CancelCommit") + dctx.add("") dctx.add("
LP: {self.mmmodule.html_link(dctx)}::{self.local_class.html_link(dctx)}::{self.html_link(dctx)}
") if is_redef then dctx.add("redef ") @@ -1027,12 +1091,12 @@ redef class MMLocalProperty dctx.add("::{mmmodule[intro_class.global].html_link(dctx)}") end if is_redef then - dctx.add("::{mmmodule[intro_class.global][global].html_link(dctx)}") + dctx.add("::{mmmodule[intro_class.global][global].global.intro.html_link(dctx)}") else dctx.add("::{html_name}") end dctx.add("{global.intro.doc.to_html}") + dctx.add("
{global.intro.doc.to_html}") + dctx.add("") + dctx.add("CancelCommit") + dctx.add("") end var tlmods = new Array[MMModule] @@ -1079,12 +1146,22 @@ redef class MMLocalProperty dctx.add("
TLP: {tm} x {lc} : {tlp.full_name}
") - var doc = tlp.doc + var n = tlp.node if doc != null and (not introdoc or global.intro.doc != doc) then - dctx.add("{doc.to_html}") + if n != null then + var l = n.location + dctx.add("
{doc.to_html}") + end + else if not is_redef then + if n != null then + var l = n.location + dctx.add("New comment\n") + end end + dctx.add("") + dctx.add("CancelCommit") + dctx.add("") dctx.add("
") if tlp.local_class.global != lc.global then dctx.add("inherited from {tlp.local_class.html_link(dctx)} ") @@ -1092,7 +1169,6 @@ redef class MMLocalProperty if tm != tlp.mmmodule then dctx.add("defined by the module {tlp.mmmodule.html_link(dctx)} ") end - var n = tlp.node if n != null then var l = n.location dctx.show_source(l) @@ -1114,11 +1190,6 @@ redef class MMLocalProperty var l = n.location dctx.show_source(l) end - - #var doc = lp.doc - #if doc != null and (not introdoc or global.intro.doc != doc) then - # dctx.add("
{doc.to_html}") - #end end dctx.close_stage dctx.add("") @@ -1196,7 +1267,11 @@ redef class MMLocalClass redef fun html_link(dctx) do if not require_doc(dctx) then print "{dctx.filename}: not required {self}" - return "{self}" + if short_doc == " " then + return "{self}" + else + return "{self}" + end end redef fun json_entry(dctx) do @@ -1365,11 +1440,15 @@ redef class MMLocalClass dctx.add("(unexported) ") end dctx.add("{kind} {global.intro.mmmodule.toplevel_owner.html_link(dctx)}::{name}
{doc.to_html}\n") + var l = doc.location + dctx.add("
{doc.to_html}\n") + dctx.add("") + dctx.add("CancelCommit") + dctx.add("") end var cla = new HashSet[MMLocalClass] @@ -1414,7 +1493,12 @@ redef class MMLocalClass end op.append("\}\n") dctx.gen_dot(op.to_s, name.to_s, "Inheritance graph for class {name}") + dctx.add("
Introduced by {m.html_link(dctx)}") - else - dctx.add("
Refined by {m.html_link(dctx)}") - end - dctx.open_stage - dctx.stage(". Definition in:") - for lc in crhe.greaters do + short_doc = "" + if m.short_doc != " " then short_doc = ": {m.short_doc}" + dctx.add("
{nm.html_name}{short_doc}
\n") + end + + var pps = redefs[m][nm] + dctx.sort(pps) + for p in pps do + p.full_documentation(dctx, self) + end + end + end + if not inhs.is_empty then dctx.open_stage dctx.stage("Defined in {lc.html_link(dctx)}:") + + var ims = new Array[MMMethod] for p in inh[lc] do if p.global.is_init then continue if not p isa MMMethod then continue + ims.add(p) + end + + var i = 0 + for p in ims do dctx.add(" {p.html_link(dctx)}") + if i < ims.length - 1 then dctx.add(",") + i += 1 end + dctx.stage("
") dctx.close_stage end