for child in children.values do
if child isa WikiArticle and child.is_index then return child
end
- return new WikiSectionIndex(wiki, self)
+ return new WikiSectionIndex(wiki, "index", self)
end
redef fun tpl_link do return index.tpl_link
#
# The generated tree will be something like this:
#
- # <ul>
- # <li>section 1</li>
- # <li>section 2
- # <ul>
- # <li>section 2.1</li>
- # <li>section 2.2</li>
- # </ul>
- # </li>
- # </ul>
+ # ~~~html
+ # <ul>
+ # <li>section 1</li>
+ # <li>section 2
+ # <ul>
+ # <li>section 2.1</li>
+ # <li>section 2.2</li>
+ # </ul>
+ # </li>
+ # </ul>
+ # ~~~
fun tpl_tree(limit: Int): Template do
return tpl_tree_intern(limit, 1)
end
# The section described by `self`.
var section: WikiSection
- init(wiki: Nitiwiki, section: WikiSection) do
- super(wiki, "index")
- self.section = section
- end
-
redef var is_dirty = false
redef fun tpl_article do
class TplArticle
super Template
+ # Article title.
var title: nullable Streamable = null
+
+ # Article HTML body.
var body: nullable Streamable = null
+
+ # Sidebar of this article (if any).
var sidebar: nullable TplSidebar = null
+
+ # Breadcrumbs from wiki root to this article.
var breadcrumbs: nullable TplBreadcrumbs = null
+ # Init `self` with a `title`.
init with_title(title: Streamable) do
self.title = title
end