chore: remove old parser
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
e3511f2930
commit
a3a678b7af
85
tools/challenge-parser/parser/tools/example.md
Normal file
85
tools/challenge-parser/parser/tools/example.md
Normal file
@@ -0,0 +1,85 @@
|
||||
# --description--
|
||||
|
||||
Paragraph 1
|
||||
|
||||
```html
|
||||
code example
|
||||
```
|
||||
|
||||
# --instructions--
|
||||
|
||||
Paragraph 0
|
||||
|
||||
```html
|
||||
code example 0
|
||||
```
|
||||
|
||||
# --hints--
|
||||
|
||||
First hint
|
||||
|
||||
```js
|
||||
// test code
|
||||
```
|
||||
|
||||
Second hint with <code>code</code>
|
||||
|
||||
```js
|
||||
// more test code
|
||||
```
|
||||
|
||||
Third *hint* with <code>code</code> and `inline code`
|
||||
|
||||
```js
|
||||
// more test code
|
||||
if(let x of xs) {
|
||||
console.log(x);
|
||||
}
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
## --seed-contents--
|
||||
|
||||
```html
|
||||
<html>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
![key-for-css]()
|
||||
|
||||
```css
|
||||
body {
|
||||
background: green;
|
||||
}
|
||||
```
|
||||
|
||||
![key-for-js]()
|
||||
|
||||
```js
|
||||
var x = 'y';
|
||||
```
|
||||
|
||||
|
||||
# --solutions--
|
||||
|
||||
![html-key]()
|
||||
|
||||
```html
|
||||
<html>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
```css
|
||||
body {
|
||||
background: white;
|
||||
}
|
||||
```
|
||||
|
||||
```js
|
||||
var x = 'y';
|
||||
``
|
10
tools/challenge-parser/parser/tools/full-parse.js
Normal file
10
tools/challenge-parser/parser/tools/full-parse.js
Normal file
@@ -0,0 +1,10 @@
|
||||
const { inspect } = require('util');
|
||||
const path = require('path');
|
||||
|
||||
const { parsemd } = require('../index');
|
||||
|
||||
(async () => {
|
||||
const fullPath = path.resolve(__dirname, '../__fixtures__/realistic.md');
|
||||
const output = await parsemd(fullPath);
|
||||
console.log(inspect(output, null, null, true));
|
||||
})();
|
14
tools/challenge-parser/parser/tools/generate-ast.js
Normal file
14
tools/challenge-parser/parser/tools/generate-ast.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const { read } = require('to-vfile');
|
||||
const remark = require('remark');
|
||||
const directive = require('remark-directive');
|
||||
const frontmatter = require('remark-frontmatter');
|
||||
|
||||
(async () => {
|
||||
const path = './example.md';
|
||||
const file = await read(path);
|
||||
await remark()
|
||||
.use(directive)
|
||||
.use(frontmatter, ['yaml'])
|
||||
.use(() => tree => console.log(JSON.stringify(tree)))
|
||||
.process(file);
|
||||
})();
|
13
tools/challenge-parser/parser/tools/inspect-ast.js
Normal file
13
tools/challenge-parser/parser/tools/inspect-ast.js
Normal file
@@ -0,0 +1,13 @@
|
||||
const { read } = require('to-vfile');
|
||||
const remark = require('remark');
|
||||
const html = require('remark-html');
|
||||
const { inspect } = require('util');
|
||||
|
||||
(async () => {
|
||||
const path = './example.md';
|
||||
const file = await read(path);
|
||||
await remark()
|
||||
.use(() => tree => console.log(inspect(tree, null, null, true)))
|
||||
.use(html)
|
||||
.process(file);
|
||||
})();
|
12
tools/challenge-parser/parser/tools/parse-md.js
Normal file
12
tools/challenge-parser/parser/tools/parse-md.js
Normal file
@@ -0,0 +1,12 @@
|
||||
const { read } = require('to-vfile');
|
||||
const remark = require('remark');
|
||||
const html = require('remark-html');
|
||||
|
||||
(async () => {
|
||||
const path = './example.md';
|
||||
const file = await read(path);
|
||||
const contents = await remark()
|
||||
.use(html)
|
||||
.process(file);
|
||||
console.log(contents);
|
||||
})();
|
Reference in New Issue
Block a user