summaryrefslogtreecommitdiff
path: root/riki.md
blob: 1725109c8e8aafa911ba603753a1c0122a20a120 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
---
title: riki statis site generator
subtitle: Subset of ikiwiki rewritten in Rust
bindings:
- subplot/riki.yaml
- lib/files.yaml
- lib/runcmd.yaml
impls:
  rust:
  - subplot/riki.rs
...

[ikiwiki]: http://ikiwiki.info/

# Introduction

`riki` is a small subset of [ikiwiki][] rewritten in Rust, for
speed.

# Verification scenarios

## Markdown features

### Empty Markdown file

_Requirement: Given an empty input Markdown file, the output must
be an empty HTML file._

~~~scenario
given an installed riki
given file site/empty.mdwn from empty
when I run riki site output
then AST of site/empty.mdwn matches that of output/empty.html
~~~


~~~{#empty .file}
~~~

### Plain text

_Requirement: Given a Markdown file with plain text, the output must
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 site output
then AST of site/page.mdwn matches that of output/page.html
~~~


~~~{#para .file}
Hello, world.

There are two paragraphs.
~~~


### Indented code block

_Requirement: Given a Markdown file with an indented code block, the
output must have a pre element.

~~~scenario
given an installed riki
given file site/page.mdwn from indented-code
when I run riki site output
then AST of site/page.mdwn matches that of output/page.html
~~~


~~~{#indented-code .file}
    This is indented by four spaces.
~~~


### Fenced code block

_Requirement: Given a Markdown file with a fenced code block, the
output must have a pre element.

~~~scenario
given an installed riki
given file site/page.mdwn from fenced-code
when I run riki site output
then AST of site/page.mdwn matches that of output/page.html
~~~


~~~{#fenced-code .file}
```
This is a fenced code block.
```
~~~



### Image link

_Requirement: Given a Markdown file linking to an image, the output
must have an img element.

~~~scenario
given an installed riki
given file site/page.mdwn from image-link
when I run riki site output
then AST of site/page.mdwn matches that of output/page.html
~~~


~~~{#image-link .file}
![my kitten](cat.jpg)
~~~

### Emphasised text

_Requirement: Inline markup for emphasis must result in an em element
in HTML output._

~~~scenario
given an installed riki
given file site/page.mdwn from emph
when I run riki site output
then AST of site/page.mdwn matches that of output/page.html
~~~


~~~{#emph .file}
There is *emphasized*, and so is _this_.
~~~

### Strongly emphasised text

_Requirement: Inline markup for strong emphasis must result in a
strong element in HTML output._

~~~scenario
given an installed riki
given file site/page.mdwn from strong
when I run riki site output
then AST of site/page.mdwn matches that of output/page.html
~~~


~~~{#strong .file}
There is **emphasized**, and so is __this__.
~~~

### Strike through in text

_Requirement: Inline markup for strike through must result in a del
element in HTML output._

~~~scenario
given an installed riki
given file site/page.mdwn from strike
when I run riki site output
then AST of site/page.mdwn matches that of output/page.html
~~~


~~~{#strike .file}
There is ~~struck through~~.
~~~

### Top level heading

_Requirement: Given a Markdown file with top level heading, the output must
be an HTML file with one h1 element, without extra elements._

~~~scenario
given an installed riki
given file site/page.mdwn from h1
when I run riki site output
then AST of site/page.mdwn matches that of output/page.html
~~~


~~~{#h1 .file}
# Heading
~~~

### Inline code

_Requirement: Inline code markup with backticks must result in a code
element in HTML output._

~~~scenario
given an installed riki
given file site/page.mdwn from backticks
when I run riki site output
then AST of site/page.mdwn matches that of output/page.html
~~~


~~~{#backticks .file}
There is `code` lurking here.
~~~