fun need_render(src, target: String): Bool do
if force_render then return true
if not target.file_exists then return true
fun need_render(src, target: String): Bool do
if force_render then return true
if not target.file_exists then return true
path = path.simplify_path
if entries.has_key(path) then return entries[path].as(WikiSection)
var root = expand_path(config.root_dir, config.source_dir)
path = path.simplify_path
if entries.has_key(path) then return entries[path].as(WikiSection)
var root = expand_path(config.root_dir, config.source_dir)
var section = new WikiSection(self, name)
entries[path] = section
if path == root then return section
var section = new WikiSection(self, name)
entries[path] = section
if path == root then return section
# Used to translate ids in beautiful page names.
fun pretty_name(name: String): String do
name = name.replace("_", " ")
# Used to translate ids in beautiful page names.
fun pretty_name(name: String): String do
name = name.replace("_", " ")
# Returns `-1` if not `has_source`.
fun last_edit_time: Int do
if not has_source then return -1
# Returns `-1` if not `has_source`.
fun last_edit_time: Int do
if not has_source then return -1
# then returns the main wiki template file.
fun template_file: String do
if is_root then return wiki.config.template_file
# then returns the main wiki template file.
fun template_file: String do
if is_root then return wiki.config.template_file
# Behave like `template_file`.
fun header_file: String do
if is_root then return wiki.config.header_file
# Behave like `template_file`.
fun header_file: String do
if is_root then return wiki.config.header_file
# Behave like `template_file`.
fun footer_file: String do
if is_root then return wiki.config.footer_file
# Behave like `template_file`.
fun footer_file: String do
if is_root then return wiki.config.footer_file
- private fun value_or_default(key: String, default: String): String do
- if not has_key(key) then return default
- return self[key]
+ protected fun value_or_default(key: String, default: String): String do
+ return self[key] or else default
var sidebar_blocks: Array[String] is lazy do
var res = new Array[String]
if not has_key("wiki.sidebar.blocks") then return res
var sidebar_blocks: Array[String] is lazy do
var res = new Array[String]
if not has_key("wiki.sidebar.blocks") then return res
# Returns the config value at `key` or `null` if no key was found.
private fun value_or_null(key: String): nullable String do
# Returns the config value at `key` or `null` if no key was found.
private fun value_or_null(key: String): nullable String do