SNRK-71: parseMd is implemented

This commit is contained in:
liubar.pa 2023-05-05 00:07:59 +03:00
parent 248677dad9
commit e0ef373c48

View File

@ -1,7 +1,16 @@
package documentBuilder
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import com.fasterxml.jackson.module.kotlin.readValue
private val MARKDOWN_PARSER = "../nodejs/MarkdownParser.js"
public suspend fun parseMd(mdFile: ByteArray): MdAstRoot {
TODO()
return jacksonObjectMapper()
.readValue<MdAstRoot>(ProcessBuilder("node", MARKDOWN_PARSER, mdFile.toString())
.redirectOutput(ProcessBuilder.Redirect.PIPE)
.redirectError(ProcessBuilder.Redirect.INHERIT)
.start().inputStream.bufferedReader().readText())
}
public suspend fun buildDependencyGraphNode(mdFile: ByteArray): DependencyGraphNode {