nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lib/markdown: merge processor and emitter
[nit.git]
/
contrib
/
nitiwiki
/
src
/
wiki_html.nit
diff --git
a/contrib/nitiwiki/src/wiki_html.nit
b/contrib/nitiwiki/src/wiki_html.nit
index
8042af6
..
d82bcb6
100644
(file)
--- a/
contrib/nitiwiki/src/wiki_html.nit
+++ b/
contrib/nitiwiki/src/wiki_html.nit
@@
-50,7
+50,7
@@
redef class Nitiwiki
# Markdown processor used for inline element such as titles in TOC.
private var inline_processor: MarkdownProcessor is lazy do
var proc = new MarkdownProcessor
# Markdown processor used for inline element such as titles in TOC.
private var inline_processor: MarkdownProcessor is lazy do
var proc = new MarkdownProcessor
- proc.emitter.decorator = new InlineDecorator
+ proc.decorator = new InlineDecorator
return proc
end
return proc
end
@@
-70,7
+70,8
@@
end
redef class WikiSection
# Output directory (where to ouput the HTML pages for this section).
redef class WikiSection
# Output directory (where to ouput the HTML pages for this section).
- redef fun out_path: String do
+ redef fun out_path do
+ var parent = self.parent
if parent == null then
return wiki.config.out_dir
else
if parent == null then
return wiki.config.out_dir
else
@@
-104,7
+105,7
@@
redef class WikiSection
# Copy attached files from `src_path` to `out_path`.
private fun copy_files do
assert has_source
# Copy attached files from `src_path` to `out_path`.
private fun copy_files do
assert has_source
- var dir = src_full_path.to_s
+ var dir = src_full_path.as(not null).to_s
for name in dir.files do
if name == wiki.config_filename then continue
if name.has_suffix(".md") then continue
for name in dir.files do
if name == wiki.config_filename then continue
if name.has_suffix(".md") then continue
@@
-167,7
+168,8
@@
end
redef class WikiArticle
redef class WikiArticle
- redef fun out_path: String do
+ redef fun out_path do
+ var parent = self.parent
if parent == null then
return wiki.expand_path(wiki.config.out_dir, "{name}.html")
else
if parent == null then
return wiki.expand_path(wiki.config.out_dir, "{name}.html")
else
@@
-189,10
+191,7
@@
redef class WikiArticle
fun load_template(template_file: String): TemplateString do
var tpl = wiki.load_template(template_file)
if tpl.has_macro("ROOT_URL") then
fun load_template(template_file: String): TemplateString do
var tpl = wiki.load_template(template_file)
if tpl.has_macro("ROOT_URL") then
- var root_dir = href.dirname.relpath("")
- # Avoid issues if the macro is just followed by a `/` (as with url prefix)
- if root_dir == "" then root_dir = "."
- tpl.replace("ROOT_URL", root_dir)
+ tpl.replace("ROOT_URL", root_href)
end
return tpl
end
end
return tpl
end