summaryrefslogtreecommitdiff
path: root/riki.md
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2022-09-17 10:04:32 +0300
committerLars Wirzenius <liw@liw.fi>2022-09-17 10:04:32 +0300
commit8955d701680ef8ecc8f32549a44058b788083484 (patch)
treef43817dc49619003aa7344ad5cc7dd87a611f855 /riki.md
parentbb3acba653c3c93f564f2e1573fc3b76bd519175 (diff)
downloadriki-8955d701680ef8ecc8f32549a44058b788083484.tar.gz
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
Diffstat (limited to 'riki.md')
-rw-r--r--riki.md48
1 files changed, 24 insertions, 24 deletions
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
~~~
<!--
@@ -313,7 +313,7 @@ in HTML output._
given an installed riki
given file site/page.mdwn from tasklist
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
~~~
@@ -347,7 +347,7 @@ then stderr contains "definition list"
given file site/page.mdwn from dl-3
when I run riki build --plain-body site output
-then file output/page.html contains ": bar"
+then file output/page/index.html contains ": bar"
~~~
~~~{#dl-1 .file}
@@ -381,10 +381,10 @@ given file site/dir/sibling.mdwn from empty
given file site/dir/foo/child.mdwn from empty
given file site/dir/foo/child/grandchild.mdwn from empty
when I run riki build --plain-body site output
-then file output/dir/foo.html contains "href="../absolute""
-then file output/dir/foo.html contains "href="sibling""
-then file output/dir/foo.html contains "href="foo/child""
-then file output/dir/foo.html contains "href="foo/child/grandchild""
+then file output/dir/foo/index.html contains "href="../absolute""
+then file output/dir/foo/index.html contains "href="sibling""
+then file output/dir/foo/index.html contains "href="foo/child""
+then file output/dir/foo/index.html contains "href="foo/child/grandchild""
~~~
Note the uppercase link to the `child` page in the test page below.
@@ -558,7 +558,7 @@ given an installed riki
given file site/a.mdwn from use_shortcut
given file site/b.mdwn from define_shortcut
when I run riki build site output
-then file output/a.html contains "<a href="https://example.com/foo/123">foo!123</a>"
+then file output/a/index.html contains "<a href="https://example.com/foo/123">foo!123</a>"
~~~
~~~{#use_shortcut .file .markdown}
@@ -635,8 +635,8 @@ given an installed riki
given file site/foo/page.mdwn from image
given file site/bar/image.jpg from para
when I run riki build --plain-body site output
-then AST of site/foo/page.mdwn matches that of output/foo/page.html
-then files site/bar//image.jpg and output/bar/image.jpg match
+then AST of site/foo/page.mdwn matches that of output/foo/page/index.html
+then files site/bar/image.jpg and output/bar/image.jpg match
~~~
## Output directory tree