Merge: Fix nitiwiki: Fixes auto-index links.
authorJean Privat <jean@pryen.org>
Tue, 20 Jan 2015 04:18:52 +0000 (11:18 +0700)
committerJean Privat <jean@pryen.org>
Tue, 20 Jan 2015 04:18:52 +0000 (11:18 +0700)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

Pull-Request: #1112
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

contrib/nitiwiki/src/wiki_html.nit
contrib/nitiwiki/tests/res/nitiwiki_render.res
contrib/nitiwiki/tests/res/nitiwiki_status.res

index 7f213b7..89546ce 100644 (file)
@@ -81,6 +81,7 @@ redef class WikiSection
                end
                var index = self.index
                if index isa WikiSectionIndex then
+                       wiki.message("Render auto-index for section {out_path}", 1)
                        index.is_dirty = true
                        add_child index
                end
@@ -322,6 +323,10 @@ class WikiSectionIndex
        # The section described by `self`.
        var section: WikiSection
 
+       redef fun title do return section.title
+
+       redef fun url do return section.url
+
        redef var is_dirty = false
 
        redef fun tpl_article do
index adf25a7..25f17ab 100644 (file)
@@ -1 +1,6 @@
 Render section out
+Render section out/sec1
+Render section out/sec2
+Render auto-index for section out/sec2
+Render section out/sec2/sub-sec21
+Render section out/sec2/sub-sec22
index 936a764..9eb2262 100644 (file)
@@ -6,5 +6,12 @@ url: http://localhost/
 There is modified files:
  + pages
  + /pages/index.md
+ + pages/sec1
+ + /pages/sec1/index.md
+ + pages/sec2
+ + pages/sec2/sub-sec21
+ + /pages/sec2/sub-sec21/index.md
+ + pages/sec2/sub-sec22
+ + /pages/sec2/sub-sec22/index.md
 
 Use nitiwiki --render to render modified files