From 16bde7a48eca66114f9adaa0f87e7fa43ff4211e Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 17 Jul 2022 19:38:30 +0300 Subject: feat: "meta title" directive Add some infrastructure for directives, and implement the meta title directive. Sponsored-by: author --- riki.md | 55 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 19 deletions(-) (limited to 'riki.md') diff --git a/riki.md b/riki.md index 40ea5e7..85abe81 100644 --- a/riki.md +++ b/riki.md @@ -38,7 +38,7 @@ be an empty HTML file._ ~~~scenario given an installed riki given file site/empty.mdwn from empty -when I run riki build site output +when I run riki build --plain-body site output then AST of site/empty.mdwn matches that of output/empty.html ~~~ @@ -54,7 +54,7 @@ be an HTML file with the same text, without extra elements._ ~~~scenario given an installed riki given file site/page.mdwn from para -when I run riki build site output +when I run riki build --plain-body site output then AST of site/page.mdwn matches that of output/page.html ~~~ @@ -74,7 +74,7 @@ output must have a blockquote element. ~~~scenario given an installed riki given file site/page.mdwn from blockquote -when I run riki build site output +when I run riki build --plain-body site output then AST of site/page.mdwn matches that of output/page.html ~~~ @@ -92,7 +92,7 @@ output must have a pre element. ~~~scenario given an installed riki given file site/page.mdwn from indented-code -when I run riki build site output +when I run riki build --plain-body site output then AST of site/page.mdwn matches that of output/page.html ~~~ @@ -110,7 +110,7 @@ output must have a pre element. ~~~scenario given an installed riki given file site/page.mdwn from fenced-code -when I run riki build site output +when I run riki build --plain-body site output then AST of site/page.mdwn matches that of output/page.html ~~~ @@ -131,7 +131,7 @@ must have an img element. ~~~scenario given an installed riki given file site/page.mdwn from image-link -when I run riki build site output +when I run riki build --plain-body site output then AST of site/page.mdwn matches that of output/page.html ~~~ @@ -148,7 +148,7 @@ in HTML output._ ~~~scenario given an installed riki given file site/page.mdwn from emph -when I run riki build site output +when I run riki build --plain-body site output then AST of site/page.mdwn matches that of output/page.html ~~~ @@ -165,7 +165,7 @@ strong element in HTML output._ ~~~scenario given an installed riki given file site/page.mdwn from strong -when I run riki build site output +when I run riki build --plain-body site output then AST of site/page.mdwn matches that of output/page.html ~~~ @@ -182,7 +182,7 @@ element in HTML output._ ~~~scenario given an installed riki given file site/page.mdwn from strike -when I run riki build site output +when I run riki build --plain-body site output then AST of site/page.mdwn matches that of output/page.html ~~~ @@ -201,7 +201,7 @@ supported._ ~~~scenario given an installed riki given file site/page.mdwn from headings -when I run riki build site output +when I run riki build --plain-body site output then AST of site/page.mdwn matches that of output/page.html ~~~ @@ -223,7 +223,7 @@ element in HTML output._ ~~~scenario given an installed riki given file site/page.mdwn from backticks -when I run riki build site output +when I run riki build --plain-body site output then AST of site/page.mdwn matches that of output/page.html ~~~ @@ -242,7 +242,7 @@ output._ ~~~ given an installed riki given file site/page.mdwn from table -when I run riki build site output +when I run riki build --plain-body site output then AST of site/page.mdwn matches that of output/page.html ~~~ @@ -261,7 +261,7 @@ HTML output._ ~~~scenario given an installed riki given file site/page.mdwn from rule -when I run riki build site output +when I run riki build --plain-body site output then AST of site/page.mdwn matches that of output/page.html ~~~ @@ -282,7 +282,7 @@ in HTML output._ ~~~scenario given an installed riki given file site/page.mdwn from ul -when I run riki build site output +when I run riki build --plain-body site output then AST of site/page.mdwn matches that of output/page.html ~~~ @@ -303,7 +303,7 @@ the same as the Markdown.*** ~~~ given an installed riki given file site/page.mdwn from ol -when I run riki build site output +when I run riki build --plain-body site output then AST of site/page.mdwn matches that of output/page.html ~~~ @@ -321,7 +321,7 @@ in HTML output._ ~~~scenario given an installed riki given file site/page.mdwn from tasklist -when I run riki build site output +when I run riki build --plain-body site output then AST of site/page.mdwn matches that of output/page.html ~~~ @@ -339,7 +339,7 @@ into the destination directory as-is._ ~~~scenario given an installed riki given file site/image.jpg from image -when I run riki build site output +when I run riki build --plain-body site output then files site/image.jpg and output/image.jpg match ~~~ @@ -359,7 +359,7 @@ directory._ 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 site output +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 ~~~ @@ -376,7 +376,7 @@ given file site/absolute.mdwn from empty 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 site output +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="dir/sibling"" then file output/dir/foo.html contains "href="dir/foo/child"" @@ -391,3 +391,20 @@ then file output/dir/foo.html contains "href="/missing" [[child/grandchild]] [[missing]] ~~~ + +## Directives + +### `meta title` + +_Requirement: the `meta title` directive sets page title._ + +~~~scenario +given an installed riki +given file site/index.mdwn from meta +when I run riki build site output +then file output/index.html contains "Yo" +~~~ + +~~~{#meta .file .markdown} +[[!meta title=Yo]]] +~~~ -- cgit v1.2.1