Repository navigation
Expand file tree
/
Copy pathdocs.json
More file actions
242 lines (242 loc) · 8.01 KB
/
Copy pathdocs.json
File metadata and controls
242 lines (242 loc) · 8.01 KB
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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
[
{
"name": "flat ordered pages",
"files": {
"01-intro.mdx": "---\ntitle: Intro\ndescription: Where to start.\n---\n\n# Intro\n\nHello.\n",
"02-usage.mdx": "---\ntitle: Usage\ndescription: How to use it.\n---\n\n# Usage\n\nMore.\n"
}
},
{
"name": "one folder deep",
"files": {
"01-reference/01-cli.mdx": "---\ntitle: Command line\ndescription: Every command and flag.\n---\n\n# Command line\n"
}
},
{
"name": "a playground pair",
"files": {
"01-intro.mdx": "---\ntitle: Intro\ndescription: Where to start.\n---\n\n# Intro\n\n```edge-python\nprint(1)\n```\n\n```output\n1\n```\n"
}
},
{
"name": "a runnable fence needs no output",
"files": {
"01-intro.mdx": "---\ntitle: Intro\ndescription: Where to start.\n---\n\n# Intro\n\n```edge-python\nprint(1)\n```\n"
}
},
{
"name": "a heading inside a fence is not a heading",
"files": {
"01-intro.mdx": "---\ntitle: Intro\ndescription: Where to start.\n---\n\n# Intro\n\n```python\n# not a heading\n```\n"
}
},
{
"name": "a file that is not a page is ignored",
"files": {
"01-intro.mdx": "---\ntitle: Intro\ndescription: Where to start.\n---\n\n# Intro\n",
"notes.txt": "ignored\n"
}
},
{
"name": "an underscore orders a segment too",
"files": {
"01_intro.mdx": "---\ntitle: Intro\ndescription: Where to start.\n---\n\n# Intro\n"
}
},
{
"name": "a key beyond the two required ones is allowed",
"files": {
"01-intro.mdx": "---\ntitle: Intro\ndescription: Where to start.\ndraft: true\n---\n\n# Intro\n"
}
},
{
"name": "no docs directory",
"files": {},
"error": "no directory is there"
},
{
"name": "a directory with no pages",
"files": { "README.md": "# not a page\n" },
"error": "no .mdx pages"
},
{
"name": "two folders deep",
"files": {
"01-a/02-b/03-c.mdx": "---\ntitle: C\ndescription: Too deep.\n---\n\n# C\n"
},
"error": "nests deeper than one folder"
},
{
"name": "a page with no numeric prefix",
"files": {
"intro.mdx": "---\ntitle: Intro\ndescription: Where to start.\n---\n\n# Intro\n"
},
"error": "needs a numeric prefix"
},
{
"name": "a folder with no numeric prefix",
"files": {
"reference/01-cli.mdx": "---\ntitle: Cli\ndescription: Every command.\n---\n\n# Cli\n"
},
"error": "needs a numeric prefix"
},
{
"name": "digits with no separator do not order",
"files": {
"01intro.mdx": "---\ntitle: Intro\ndescription: Where to start.\n---\n\n# Intro\n"
},
"error": "needs a numeric prefix"
},
{
"name": "a page with no frontmatter",
"files": { "01-intro.mdx": "# Intro\n" },
"error": "opens with no frontmatter"
},
{
"name": "frontmatter with no title",
"files": { "01-intro.mdx": "---\ndescription: Where to start.\n---\n\n# Intro\n" },
"error": "needs both a title and a description"
},
{
"name": "frontmatter with no description",
"files": { "01-intro.mdx": "---\ntitle: Intro\n---\n\n# Intro\n" },
"error": "needs both a title and a description"
},
{
"name": "frontmatter with an empty description",
"files": { "01-intro.mdx": "---\ntitle: Intro\ndescription:\n---\n\n# Intro\n" },
"error": "leaves the frontmatter 'description' empty"
},
{
"name": "a frontmatter line that is no key and value",
"files": { "01-intro.mdx": "---\ntitle: Intro\ndescription: Where to start.\njust prose\n---\n\n# Intro\n" },
"error": "which is no key and value"
},
{
"name": "unterminated frontmatter",
"files": { "01-intro.mdx": "---\ntitle: Intro\ndescription: Where to start.\n" },
"error": "frontmatter unterminated"
},
{
"name": "a page with no heading",
"files": {
"01-intro.mdx": "---\ntitle: Intro\ndescription: Where to start.\n---\n\nJust prose.\n"
},
"error": "has 0 top-level headings"
},
{
"name": "a page with two headings",
"files": {
"01-intro.mdx": "---\ntitle: Intro\ndescription: Where to start.\n---\n\n# One\n\n# Two\n"
},
"error": "has 2 top-level headings"
},
{
"name": "an output block on its own",
"files": {
"01-intro.mdx": "---\ntitle: Intro\ndescription: Where to start.\n---\n\n# Intro\n\n```output\n1\n```\n"
},
"error": "follows no edge-python block"
},
{
"name": "an output block separated by prose",
"files": {
"01-intro.mdx": "---\ntitle: Intro\ndescription: Where to start.\n---\n\n# Intro\n\n```edge-python\nprint(1)\n```\n\nProse between.\n\n```output\n1\n```\n"
},
"error": "follows no edge-python block"
},
{
"name": "an output block after a plain fence",
"files": {
"01-intro.mdx": "---\ntitle: Intro\ndescription: Where to start.\n---\n\n# Intro\n\n```python\nprint(1)\n```\n\n```output\n1\n```\n"
},
"error": "follows no edge-python block"
},
{
"name": "an unterminated fence",
"files": {
"01-intro.mdx": "---\ntitle: Intro\ndescription: Where to start.\n---\n\n# Intro\n\n```edge-python\nprint(1)\n"
},
"error": "unterminated"
},
{
"name": "a script tag in prose",
"files": {
"01-intro.mdx": "---\ntitle: Intro\ndescription: Where to start.\n---\n\n# Intro\n\n<script>alert(1)</script>\n"
},
"error": "writes the raw HTML '<script>'"
},
{
"name": "a closing tag in prose",
"files": {
"01-intro.mdx": "---\ntitle: Intro\ndescription: Where to start.\n---\n\n# Intro\n\n</div>\n"
},
"error": "writes the raw HTML '</div>'"
},
{
"name": "an image tag carrying a handler",
"files": {
"01-intro.mdx": "---\ntitle: Intro\ndescription: Where to start.\n---\n\n# Intro\n\n<img src=x onerror=alert(1)>\n"
},
"error": "writes the raw HTML '<img'"
},
{
"name": "a tag after a comparison on the same line",
"files": {
"01-intro.mdx": "---\ntitle: Intro\ndescription: Where to start.\n---\n\n# Intro\n\nWhere a < b, and <iframe></iframe> follows.\n"
},
"error": "writes the raw HTML '<iframe>'"
},
{
"name": "html inside a fence is not html",
"files": {
"01-intro.mdx": "---\ntitle: Intro\ndescription: Where to start.\n---\n\n# Intro\n\n```html\n<script>alert(1)</script>\n```\n"
}
},
{
"name": "a tag inside inline code is not html",
"files": {
"01-intro.mdx": "---\ntitle: Intro\ndescription: Where to start.\n---\n\n# Intro\n\nNever write `<script>`, and `Vec<T>` is fine too.\n"
}
},
{
"name": "a comparison alone is not a tag",
"files": {
"01-intro.mdx": "---\ntitle: Intro\ndescription: Where to start.\n---\n\n# Intro\n\nIt holds when a < b and b > c.\n"
}
},
{
"name": "a manifest before a runnable fence",
"files": {
"01-intro.mdx": "---\ntitle: Intro\ndescription: Where to start.\n---\n\n# Intro\n\n```edge-manifest\n{ \"permissions\": { \"main\": [\"time:wall\"] } }\n```\n\n```edge-python\nimport time\n```\n\n```output\n```\n"
}
},
{
"name": "a manifest before a plain fence",
"files": {
"01-intro.mdx": "---\ntitle: Intro\ndescription: Where to start.\n---\n\n# Intro\n\n```edge-manifest\n{}\n```\n\n```python\nprint(1)\n```\n"
},
"error": "no edge-python block follows"
},
{
"name": "a manifest separated by prose",
"files": {
"01-intro.mdx": "---\ntitle: Intro\ndescription: Where to start.\n---\n\n# Intro\n\n```edge-manifest\n{}\n```\n\nProse between.\n\n```edge-python\nprint(1)\n```\n"
},
"error": "no edge-python block follows"
},
{
"name": "a manifest that ends the page",
"files": {
"01-intro.mdx": "---\ntitle: Intro\ndescription: Where to start.\n---\n\n# Intro\n\n```edge-python\nprint(1)\n```\n\n```edge-manifest\n{}\n```\n"
},
"error": "no edge-python block follows"
},
{
"name": "a manifest that is not an object",
"files": {
"01-intro.mdx": "---\ntitle: Intro\ndescription: Where to start.\n---\n\n# Intro\n\n```edge-manifest\n[\"net:api.example.com\"]\n```\n\n```edge-python\nprint(1)\n```\n"
},
"error": "is not a JSON object"
}
]