From 8955d701680ef8ecc8f32549a44058b788083484 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 17 Sep 2022 10:04:32 +0300 Subject: feat! generate foo/index.html for foo.mdwn (ikiwiki usedirs) Implement the ikiwiki "usedirs" functionality in riki, so that riki generates compatible URLs with ikiwiki. This means that for an input page foo.mdwn, riki generates an output page of foo/index.html. ikiwiki has its "usedirs" setting enabled by default, with the following justification: There are several advantages to `usedirs`, including simpler URLs, URLs that aren't dependent on the underlying implementation (`.html`), and being able to use URLs as tags as described in the [rel-tag microformat](http://microformats.org/wiki/rel-tag). The main disadvantage is that it is harder to browse using `file://` URIs, since `file:///dir/` doesn't automatically translate to `dir/index.html`. This is something one could fix in the browser though. For riki it's enough to be compatible with ikiwiki. Sponsored-by: author --- riki.md | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'riki.md') diff --git a/riki.md b/riki.md index f74f7a0..de4e08a 100644 --- a/riki.md +++ b/riki.md @@ -27,7 +27,7 @@ be an empty HTML file._ given an installed riki given file site/empty.mdwn from empty when I run riki build --plain-body site output -then AST of site/empty.mdwn matches that of output/empty.html +then AST of site/empty.mdwn matches that of output/empty/index.html ~~~ @@ -43,7 +43,7 @@ be an HTML file with the same text, without extra elements._ given an installed riki given file site/page.mdwn from para when I run riki build --plain-body site output -then AST of site/page.mdwn matches that of output/page.html +then AST of site/page.mdwn matches that of output/page/index.html ~~~ @@ -63,7 +63,7 @@ output must have a blockquote element. given an installed riki given file site/page.mdwn from blockquote when I run riki build --plain-body site output -then AST of site/page.mdwn matches that of output/page.html +then AST of site/page.mdwn matches that of output/page/index.html ~~~ @@ -81,7 +81,7 @@ output must have a pre element. given an installed riki given file site/page.mdwn from indented-code when I run riki build --plain-body site output -then AST of site/page.mdwn matches that of output/page.html +then AST of site/page.mdwn matches that of output/page/index.html ~~~ @@ -99,7 +99,7 @@ output must have a pre element. given an installed riki given file site/page.mdwn from fenced-code when I run riki build --plain-body site output -then AST of site/page.mdwn matches that of output/page.html +then AST of site/page.mdwn matches that of output/page/index.html ~~~ @@ -120,7 +120,7 @@ must have an img element. given an installed riki given file site/page.mdwn from image-link when I run riki build --plain-body site output -then AST of site/page.mdwn matches that of output/page.html +then AST of site/page.mdwn matches that of output/page/index.html ~~~ @@ -137,7 +137,7 @@ in HTML output._ given an installed riki given file site/page.mdwn from emph when I run riki build --plain-body site output -then AST of site/page.mdwn matches that of output/page.html +then AST of site/page.mdwn matches that of output/page/index.html ~~~ @@ -154,7 +154,7 @@ strong element in HTML output._ given an installed riki given file site/page.mdwn from strong when I run riki build --plain-body site output -then AST of site/page.mdwn matches that of output/page.html +then AST of site/page.mdwn matches that of output/page/index.html ~~~ @@ -171,7 +171,7 @@ element in HTML output._ given an installed riki given file site/page.mdwn from strike when I run riki build --plain-body site output -then AST of site/page.mdwn matches that of output/page.html +then AST of site/page.mdwn matches that of output/page/index.html ~~~ @@ -190,7 +190,7 @@ supported._ given an installed riki given file site/page.mdwn from headings when I run riki build --plain-body site output -then AST of site/page.mdwn matches that of output/page.html +then AST of site/page.mdwn matches that of output/page/index.html ~~~ @@ -212,7 +212,7 @@ element in HTML output._ given an installed riki given file site/page.mdwn from backticks when I run riki build --plain-body site output -then AST of site/page.mdwn matches that of output/page.html +then AST of site/page.mdwn matches that of output/page/index.html ~~~ @@ -231,7 +231,7 @@ output._ given an installed riki given file site/page.mdwn from table when I run riki build --plain-body site output -then AST of site/page.mdwn matches that of output/page.html +then AST of site/page.mdwn matches that of output/page/index.html ~~~ @@ -252,7 +252,7 @@ HTML output._ given an installed riki given file site/page.mdwn from rule when I run riki build --plain-body site output -then AST of site/page.mdwn matches that of output/page.html +then AST of site/page.mdwn matches that of output/page/index.html ~~~ @@ -273,7 +273,7 @@ in HTML output._ given an installed riki given file site/page.mdwn from ul when I run riki build --plain-body site output -then AST of site/page.mdwn matches that of output/page.html +then AST of site/page.mdwn matches that of output/page/index.html ~~~ @@ -294,7 +294,7 @@ the same as the Markdown.*** given an installed riki given file site/page.mdwn from ol when I run riki build --plain-body site output -then AST of site/page.mdwn matches that of output/page.html +then AST of site/page.mdwn matches that of output/page/index.html ~~~