freeCodeCamp/tools/challenge-parser/parser/__fixtures__/ast-imports.json

301 lines
7.8 KiB
JSON

{
"type": "root",
"children": [
{
"type": "leafDirective",
"name": "import",
"attributes": { "component": "Script", "from": "./script.md" },
"children": [],
"position": {
"start": { "line": 1, "column": 1, "offset": 0 },
"end": { "line": 1, "column": 50, "offset": 49 }
}
},
{
"type": "heading",
"depth": 1,
"children": [
{
"type": "text",
"value": "--description--",
"position": {
"start": { "line": 3, "column": 3, "offset": 53 },
"end": { "line": 3, "column": 18, "offset": 68 }
}
}
],
"position": {
"start": { "line": 3, "column": 1, "offset": 51 },
"end": { "line": 3, "column": 18, "offset": 68 }
}
},
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "Paragraph 1",
"position": {
"start": { "line": 5, "column": 1, "offset": 70 },
"end": { "line": 5, "column": 12, "offset": 81 }
}
}
],
"position": {
"start": { "line": 5, "column": 1, "offset": 70 },
"end": { "line": 5, "column": 12, "offset": 81 }
}
},
{
"type": "code",
"lang": "html",
"meta": null,
"value": "code example",
"position": {
"start": { "line": 7, "column": 1, "offset": 83 },
"end": { "line": 9, "column": 4, "offset": 107 }
}
},
{
"type": "heading",
"depth": 1,
"children": [
{
"type": "text",
"value": "--instructions--",
"position": {
"start": { "line": 11, "column": 3, "offset": 111 },
"end": { "line": 11, "column": 19, "offset": 127 }
}
}
],
"position": {
"start": { "line": 11, "column": 1, "offset": 109 },
"end": { "line": 11, "column": 19, "offset": 127 }
}
},
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "Paragraph 0",
"position": {
"start": { "line": 13, "column": 1, "offset": 129 },
"end": { "line": 13, "column": 12, "offset": 140 }
}
}
],
"position": {
"start": { "line": 13, "column": 1, "offset": 129 },
"end": { "line": 13, "column": 12, "offset": 140 }
}
},
{
"type": "code",
"lang": "html",
"meta": null,
"value": "code example 0",
"position": {
"start": { "line": 15, "column": 1, "offset": 142 },
"end": { "line": 17, "column": 4, "offset": 168 }
}
},
{
"type": "heading",
"depth": 1,
"children": [
{
"type": "text",
"value": "--hints--",
"position": {
"start": { "line": 19, "column": 3, "offset": 172 },
"end": { "line": 19, "column": 12, "offset": 181 }
}
}
],
"position": {
"start": { "line": 19, "column": 1, "offset": 170 },
"end": { "line": 19, "column": 12, "offset": 181 }
}
},
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "First hint",
"position": {
"start": { "line": 21, "column": 1, "offset": 183 },
"end": { "line": 21, "column": 11, "offset": 193 }
}
}
],
"position": {
"start": { "line": 21, "column": 1, "offset": 183 },
"end": { "line": 21, "column": 11, "offset": 193 }
}
},
{
"type": "code",
"lang": "js",
"meta": null,
"value": "// test code",
"position": {
"start": { "line": 23, "column": 1, "offset": 195 },
"end": { "line": 25, "column": 4, "offset": 217 }
}
},
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "Second hint with ",
"position": {
"start": { "line": 27, "column": 1, "offset": 219 },
"end": { "line": 27, "column": 18, "offset": 236 }
}
},
{
"type": "html",
"value": "<code>",
"position": {
"start": { "line": 27, "column": 18, "offset": 236 },
"end": { "line": 27, "column": 24, "offset": 242 }
}
},
{
"type": "text",
"value": "code",
"position": {
"start": { "line": 27, "column": 24, "offset": 242 },
"end": { "line": 27, "column": 28, "offset": 246 }
}
},
{
"type": "html",
"value": "</code>",
"position": {
"start": { "line": 27, "column": 28, "offset": 246 },
"end": { "line": 27, "column": 35, "offset": 253 }
}
}
],
"position": {
"start": { "line": 27, "column": 1, "offset": 219 },
"end": { "line": 27, "column": 35, "offset": 253 }
}
},
{
"type": "code",
"lang": "js",
"meta": null,
"value": "// more test code",
"position": {
"start": { "line": 29, "column": 1, "offset": 255 },
"end": { "line": 31, "column": 4, "offset": 282 }
}
},
{
"type": "heading",
"depth": 1,
"children": [
{
"type": "text",
"value": "--seed--",
"position": {
"start": { "line": 34, "column": 3, "offset": 287 },
"end": { "line": 34, "column": 11, "offset": 295 }
}
}
],
"position": {
"start": { "line": 34, "column": 1, "offset": 285 },
"end": { "line": 34, "column": 11, "offset": 295 }
}
},
{
"type": "heading",
"depth": 2,
"children": [
{
"type": "text",
"value": "--seed-contents--",
"position": {
"start": { "line": 36, "column": 4, "offset": 300 },
"end": { "line": 36, "column": 21, "offset": 317 }
}
}
],
"position": {
"start": { "line": 36, "column": 1, "offset": 297 },
"end": { "line": 36, "column": 21, "offset": 317 }
}
},
{
"type": "code",
"lang": "html",
"meta": null,
"value": "<html>\n <body>\n </body>\n</html>",
"position": {
"start": { "line": 38, "column": 1, "offset": 319 },
"end": { "line": 43, "column": 4, "offset": 364 }
}
},
{
"type": "code",
"lang": "css",
"meta": null,
"value": "body {\n background: green;\n}",
"position": {
"start": { "line": 45, "column": 1, "offset": 366 },
"end": { "line": 49, "column": 4, "offset": 406 }
}
},
{
"type": "paragraph",
"children": [
{
"type": "image",
"title": null,
"url": "",
"alt": "custom-name",
"position": {
"start": { "line": 51, "column": 1, "offset": 408 },
"end": { "line": 51, "column": 17, "offset": 424 }
}
}
],
"position": {
"start": { "line": 51, "column": 1, "offset": 408 },
"end": { "line": 51, "column": 17, "offset": 424 }
}
},
{
"type": "code",
"lang": "js",
"meta": null,
"value": "var x = 'y';",
"position": {
"start": { "line": 53, "column": 1, "offset": 426 },
"end": { "line": 55, "column": 4, "offset": 448 }
}
},
{
"type": "leafDirective",
"name": "use",
"attributes": { "component": "Script" },
"children": [],
"position": {
"start": { "line": 57, "column": 1, "offset": 450 },
"end": { "line": 57, "column": 26, "offset": 475 }
}
}
],
"position": {
"start": { "line": 1, "column": 1, "offset": 0 },
"end": { "line": 58, "column": 1, "offset": 476 }
}
}