diff --git a/snark-document-builder/src/main/kotlin/MdParser.kt b/snark-document-builder/src/main/kotlin/MdParser.kt index bf4bc83..d1ffe45 100644 --- a/snark-document-builder/src/main/kotlin/MdParser.kt +++ b/snark-document-builder/src/main/kotlin/MdParser.kt @@ -5,6 +5,7 @@ import com.fasterxml.jackson.module.kotlin.readValue import java.nio.file.Path private val MARKDOWN_PARSER = "../nodejs/MarkdownParser.js" +private val SNARK_PARSER = "../python/SnarkParse.py" public suspend fun parseMd(mdFile: ByteArray): MdAstRoot { return jacksonObjectMapper() @@ -48,5 +49,9 @@ internal suspend fun fillDependencies( } public suspend fun getIncludeFiles(string: String): List { - TODO() + return jacksonObjectMapper() + .readValue>(ProcessBuilder("python3", SNARK_PARSER, string) + .redirectOutput(ProcessBuilder.Redirect.PIPE) + .redirectError(ProcessBuilder.Redirect.INHERIT) + .start().inputStream.bufferedReader().readText()) } \ No newline at end of file