sys.system "rsync -vr --delete {root}/ {config.rsync_dir}"
end
+ # Pull data from git repository.
fun fetch do
sys.system "git pull {config.git_origin} {config.git_branch}"
end
return path.simplify_path
end
+ # Transform an id style name into a pretty printed name.
+ #
+ # Used to translate ids in beautiful page names.
fun pretty_name(name: String): String do
name = name.replace("_", " ")
name = name.capitalized
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 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