X-Git-Url: http://nitlanguage.org diff --git a/src/nitdoc.nit b/src/nitdoc.nit index e366538..d3d175c 100644 --- a/src/nitdoc.nit +++ b/src/nitdoc.nit @@ -170,7 +170,7 @@ class DocContext var custom_items = "" if self._opt_custom_menu_items.value != null then custom_items = self._opt_custom_menu_items.value.as(not null) - var action_bar = "
\n" + var action_bar = "
\n" var custom_title = "Nitdoc" if self._opt_custom_title.value != null then custom_title = self._opt_custom_title.value.as(not null) @@ -183,7 +183,6 @@ class DocContext # generate the index self.filename = "index.html" clear - addGithubInformation add("") add("{head}Overview | {custom_title}\n") add(action_bar) @@ -217,6 +216,8 @@ class DocContext add("") add("") add("") + addGithubInformation + addCommitForm add("\n") write_to("{dir}/index.html") @@ -226,9 +227,8 @@ class DocContext assert mod isa MMSrcModule if not mod.require_doc(self) then continue self.filename = mod.html_name - action_bar = "
\n" + action_bar = "
\n" clear - addGithubInformation add("") add("{head}{mod.name} module | {custom_title}\n") add(action_bar) @@ -236,6 +236,8 @@ class DocContext mod.file_page_doc(self) add("") add("") + addGithubInformation + addCommitForm add("\n") write_to("{dir}/{mod.html_name}.html") end @@ -244,9 +246,8 @@ class DocContext for c in mainmod.local_classes do if not c.require_doc(self) then continue self.filename = c.html_name - action_bar = "
\n" + action_bar = "
\n" clear - addGithubInformation add("") add("{head}{c.name} class | {custom_title}\n") add(action_bar) @@ -254,14 +255,15 @@ class DocContext c.file_page_doc(self) add("") add("") + addGithubInformation + addCommitForm add("\n") write_to("{dir}/{c.html_name}.html") end self.filename = "fullindex" - action_bar = "
\n" + action_bar = "
\n" clear - addGithubInformation add("") add("{head}Full Index | {custom_title}\n") add(action_bar) @@ -271,6 +273,8 @@ class DocContext add("") add("") add("") + addGithubInformation + addCommitForm add("\n") write_to("{dir}/full-index.html") @@ -285,6 +289,11 @@ class DocContext if not github_repo == null then add("
") end + # Add all tags for the commit form + fun addCommitForm do + add("
Signed-Off
Commit

YesNo
\n\n") + end + # Add a (source) link fo a given location fun show_source(l: Location) do @@ -303,6 +312,24 @@ class DocContext end end + # Return source link for a given location + fun get_source(l: Location): String + do + var s = opt_source.value + if s == null then + return l.file.filename.simplify_path + else + # THIS IS JUST UGLY ! (but there is no replace yet) + var x = s.split_with("%f") + s = x.join(l.file.filename.simplify_path) + x = s.split_with("%l") + s = x.join(l.line_start.to_s) + x = s.split_with("%L") + s = x.join(l.line_end.to_s) + return s + end + end + # Generate a clicable graphiz image using a dot content. # `name' refer to the filename (without extension) and the id name of the map. # `name' must also match the name of the graph in the dot content (eg. digraph NAME {...) @@ -607,13 +634,16 @@ redef class MMModule dctx.add("{m.html_link(dctx)}::") end dctx.add("{self.name}\n") - + dctx.add("
") dctx.add("
\n") var doc = doc if doc != null then dctx.add("
\n") - dctx.add("
{doc.to_html}
\n") + dctx.add("
{doc.to_html}
\n") + dctx.add("\n") + dctx.add("CancelCommit") + dctx.add("
")
 			dctx.add("
\n") end @@ -836,7 +866,7 @@ redef class MMModule var lpi = self[gp.intro.local_class.global][gp] lps.remove(lpi) - dctx.add("
  • I {lpi.html_open_link(dctx)}{lpi.html_name} ({lpi.local_class})
  • \n") + dctx.add("
  • I {lpi.html_open_link(dctx)}{lpi.html_name} ({lpi.local_class})
  • \n") if lps.length >= 1 then dctx.sort(lps) for lp in lps do @@ -1041,7 +1071,6 @@ redef class MMLocalProperty dctx.add("
    \n") dctx.add("

    {html_name}{signature.to_html(dctx, true)}

    \n") dctx.add("
    \n") - #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 ") @@ -1067,7 +1096,7 @@ redef class MMLocalProperty dctx.add("::{html_name}") end dctx.add("
    ") - + dctx.add("
    ") dctx.add("
    ") # Collect all refinement of the global property in the same global property @@ -1083,7 +1112,10 @@ redef class MMLocalProperty end end if introdoc then - 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]
    @@ -1114,12 +1146,22 @@ redef class MMLocalProperty
     				dctx.add("

    In module {tm.html_link(dctx)} :

    ") end - #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)} ") @@ -1127,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) @@ -1149,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("

    ") @@ -1404,11 +1440,15 @@ redef class MMLocalClass dctx.add("(unexported) ") end dctx.add("{kind} {global.intro.mmmodule.toplevel_owner.html_link(dctx)}::{name}
    ") - + dctx.add("
    ") dctx.add("
    \n") var doc = doc if doc != null then - dctx.add("
    {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]