SNRK-71: nodejs scripts for markdown parsing are added
This commit is contained in:
parent
e90c9728c1
commit
248677dad9
14
snark-document-builder/src/main/nodejs/MarkdownParser.js
Normal file
14
snark-document-builder/src/main/nodejs/MarkdownParser.js
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import {fromMarkdown} from 'mdast-util-from-markdown'
|
||||||
|
|
||||||
|
main()
|
||||||
|
|
||||||
|
function main()
|
||||||
|
{
|
||||||
|
if (process.argv.length < 3)
|
||||||
|
throw "No input"
|
||||||
|
|
||||||
|
const markdown_string = process.argv[2]
|
||||||
|
const mdast = fromMarkdown(markdown_string)
|
||||||
|
|
||||||
|
console.log(JSON.stringify(mdast))
|
||||||
|
}
|
4152
snark-document-builder/src/main/nodejs/package-lock.json
generated
Normal file
4152
snark-document-builder/src/main/nodejs/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
30
snark-document-builder/src/main/nodejs/package.json
Normal file
30
snark-document-builder/src/main/nodejs/package.json
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
|
||||||
|
"type": "module",
|
||||||
|
|
||||||
|
"dependencies": {
|
||||||
|
|
||||||
|
"fs": "^0.0.1-security",
|
||||||
|
|
||||||
|
"hast-util-to-html": "^8.0.4",
|
||||||
|
|
||||||
|
"mdast-util-to-hast": "^12.3.0",
|
||||||
|
|
||||||
|
"node-fetch": "^3.3.1",
|
||||||
|
|
||||||
|
"remark-html": "^15.0.2",
|
||||||
|
|
||||||
|
"remark-parse": "^10.0.1",
|
||||||
|
|
||||||
|
"require": "^2.4.20",
|
||||||
|
|
||||||
|
"to-vfile": "^7.2.4",
|
||||||
|
|
||||||
|
"unified": "^10.1.2",
|
||||||
|
|
||||||
|
"whatwg-fetch": "^3.6.2"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user