SNRK-84: better

This commit is contained in:
Leonid Pereverzin 2023-05-07 17:57:41 +03:00
parent ffaa932127
commit 046bbda23a
2 changed files with 12 additions and 11 deletions

View File

@ -53,14 +53,12 @@ public data class IncludeDependency(
} }
} }
// parent - List<MdAstElement> -------------------------------------- // parent - List<MdAstElement> -------------------------------------
// | \ // | \
// | \ // \ \
// \ \ // | \
// | \ // dependentNode - MdAstElement \
// | \ // |
// dependentNode - MdAstElement \
// |
// List<FileName> -> List<MdAstRoot> --> List<List<MdAstElement>> ===> List<MdAstElement> // List<FileName> -> List<MdAstRoot> --> List<List<MdAstElement>> ===> List<MdAstElement>
/** /**

View File

@ -6,15 +6,18 @@ import java.nio.file.Path
import java.nio.file.Paths import java.nio.file.Paths
import kotlinx.html.* import kotlinx.html.*
import kotlinx.html.dom.createHTMLDocument import kotlinx.html.dom.createHTMLDocument
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import com.fasterxml.jackson.module.kotlin.readValue
private val DEFAULT_DOCUMENT_ROOT = "main.md" private val DEFAULT_DOCUMENT_ROOT = "main.md"
public suspend fun buildDocument(documentDirectory: Directory): String { public suspend fun buildDocument(documentDirectory: Directory): String {
val dependencyGraph = buildDependencyGraph(documentDirectory) val dependencyGraph = buildDependencyGraph(documentDirectory)
println(1)
// TODO() /*resolving of dependencies*/ val roooot: MdAstRoot = dependencyGraph.nodes[""]!!.mdAst
println(2)
return "Not implemented" return jacksonObjectMapper().writeValueAsString(roooot)
// TODO прикрутить html
} }
public suspend fun buildDependencyGraph(root: Directory): DependencyGraph { public suspend fun buildDependencyGraph(root: Directory): DependencyGraph {