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

321 lines
8.4 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": "leafDirective",
"name": "import",
"attributes": { "component": "Second", "from": "./script-two.md" },
"children": [],
"position": {
"start": { "line": 2, "column": 1, "offset": 50 },
"end": { "line": 2, "column": 54, "offset": 103 }
}
},
{
"type": "heading",
"depth": 1,
"children": [
{
"type": "text",
"value": "--description--",
"position": {
"start": { "line": 4, "column": 3, "offset": 107 },
"end": { "line": 4, "column": 18, "offset": 122 }
}
}
],
"position": {
"start": { "line": 4, "column": 1, "offset": 105 },
"end": { "line": 4, "column": 18, "offset": 122 }
}
},
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "Paragraph 1",
"position": {
"start": { "line": 6, "column": 1, "offset": 124 },
"end": { "line": 6, "column": 12, "offset": 135 }
}
}
],
"position": {
"start": { "line": 6, "column": 1, "offset": 124 },
"end": { "line": 6, "column": 12, "offset": 135 }
}
},
{
"type": "code",
"lang": "html",
"meta": null,
"value": "code example",
"position": {
"start": { "line": 8, "column": 1, "offset": 137 },
"end": { "line": 10, "column": 4, "offset": 161 }
}
},
{
"type": "heading",
"depth": 1,
"children": [
{
"type": "text",
"value": "--instructions--",
"position": {
"start": { "line": 12, "column": 3, "offset": 165 },
"end": { "line": 12, "column": 19, "offset": 181 }
}
}
],
"position": {
"start": { "line": 12, "column": 1, "offset": 163 },
"end": { "line": 12, "column": 19, "offset": 181 }
}
},
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "Paragraph 0",
"position": {
"start": { "line": 14, "column": 1, "offset": 183 },
"end": { "line": 14, "column": 12, "offset": 194 }
}
}
],
"position": {
"start": { "line": 14, "column": 1, "offset": 183 },
"end": { "line": 14, "column": 12, "offset": 194 }
}
},
{
"type": "code",
"lang": "html",
"meta": null,
"value": "code example 0",
"position": {
"start": { "line": 16, "column": 1, "offset": 196 },
"end": { "line": 18, "column": 4, "offset": 222 }
}
},
{
"type": "heading",
"depth": 1,
"children": [
{
"type": "text",
"value": "--hints--",
"position": {
"start": { "line": 20, "column": 3, "offset": 226 },
"end": { "line": 20, "column": 12, "offset": 235 }
}
}
],
"position": {
"start": { "line": 20, "column": 1, "offset": 224 },
"end": { "line": 20, "column": 12, "offset": 235 }
}
},
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "First hint",
"position": {
"start": { "line": 22, "column": 1, "offset": 237 },
"end": { "line": 22, "column": 11, "offset": 247 }
}
}
],
"position": {
"start": { "line": 22, "column": 1, "offset": 237 },
"end": { "line": 22, "column": 11, "offset": 247 }
}
},
{
"type": "code",
"lang": "js",
"meta": null,
"value": "// test code",
"position": {
"start": { "line": 24, "column": 1, "offset": 249 },
"end": { "line": 26, "column": 4, "offset": 271 }
}
},
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "Second hint with ",
"position": {
"start": { "line": 28, "column": 1, "offset": 273 },
"end": { "line": 28, "column": 18, "offset": 290 }
}
},
{
"type": "html",
"value": "<code>",
"position": {
"start": { "line": 28, "column": 18, "offset": 290 },
"end": { "line": 28, "column": 24, "offset": 296 }
}
},
{
"type": "text",
"value": "code",
"position": {
"start": { "line": 28, "column": 24, "offset": 296 },
"end": { "line": 28, "column": 28, "offset": 300 }
}
},
{
"type": "html",
"value": "</code>",
"position": {
"start": { "line": 28, "column": 28, "offset": 300 },
"end": { "line": 28, "column": 35, "offset": 307 }
}
}
],
"position": {
"start": { "line": 28, "column": 1, "offset": 273 },
"end": { "line": 28, "column": 35, "offset": 307 }
}
},
{
"type": "code",
"lang": "js",
"meta": null,
"value": "// more test code",
"position": {
"start": { "line": 30, "column": 1, "offset": 309 },
"end": { "line": 32, "column": 4, "offset": 336 }
}
},
{
"type": "heading",
"depth": 1,
"children": [
{
"type": "text",
"value": "--seed--",
"position": {
"start": { "line": 35, "column": 3, "offset": 341 },
"end": { "line": 35, "column": 11, "offset": 349 }
}
}
],
"position": {
"start": { "line": 35, "column": 1, "offset": 339 },
"end": { "line": 35, "column": 11, "offset": 349 }
}
},
{
"type": "heading",
"depth": 2,
"children": [
{
"type": "text",
"value": "--seed-contents--",
"position": {
"start": { "line": 37, "column": 4, "offset": 354 },
"end": { "line": 37, "column": 21, "offset": 371 }
}
}
],
"position": {
"start": { "line": 37, "column": 1, "offset": 351 },
"end": { "line": 37, "column": 21, "offset": 371 }
}
},
{
"type": "code",
"lang": "html",
"meta": null,
"value": "<html>\n <body>\n </body>\n</html>",
"position": {
"start": { "line": 39, "column": 1, "offset": 373 },
"end": { "line": 44, "column": 4, "offset": 418 }
}
},
{
"type": "code",
"lang": "css",
"meta": null,
"value": "body {\n background: green;\n}",
"position": {
"start": { "line": 46, "column": 1, "offset": 420 },
"end": { "line": 50, "column": 4, "offset": 460 }
}
},
{
"type": "leafDirective",
"name": "use",
"attributes": { "component": "Second" },
"children": [],
"position": {
"start": { "line": 52, "column": 1, "offset": 462 },
"end": { "line": 52, "column": 26, "offset": 487 }
}
},
{
"type": "paragraph",
"children": [
{
"type": "image",
"title": null,
"url": "",
"alt": "custom-name",
"position": {
"start": { "line": 54, "column": 1, "offset": 489 },
"end": { "line": 54, "column": 17, "offset": 505 }
}
}
],
"position": {
"start": { "line": 54, "column": 1, "offset": 489 },
"end": { "line": 54, "column": 17, "offset": 505 }
}
},
{
"type": "code",
"lang": "js",
"meta": null,
"value": "var x = 'y';",
"position": {
"start": { "line": 56, "column": 1, "offset": 507 },
"end": { "line": 58, "column": 4, "offset": 529 }
}
},
{
"type": "leafDirective",
"name": "use",
"attributes": { "component": "Script" },
"children": [],
"position": {
"start": { "line": 60, "column": 1, "offset": 531 },
"end": { "line": 60, "column": 26, "offset": 556 }
}
}
],
"position": {
"start": { "line": 1, "column": 1, "offset": 0 },
"end": { "line": 61, "column": 1, "offset": 557 }
}
}