diff --git a/src/main/kotlin/converters.kt b/src/main/kotlin/converters.kt index 7fc2037..6f44554 100644 --- a/src/main/kotlin/converters.kt +++ b/src/main/kotlin/converters.kt @@ -36,7 +36,7 @@ fun convert(inputPath: Path, outputPath: Path) { ).also { logger.info("Running pandoc: ${it.command().joinToString(separator = " ")}") - }.inheritIO().start().waitFor() + }.directory(source.parent.toFile()).inheritIO().start().waitFor() val htmlPath = target.parent.resolve(source.fileName.nameWithoutExtension + ".html") @@ -61,6 +61,24 @@ fun convert(inputPath: Path, outputPath: Path) { source.copyToIgnoringExistingDirectory(target, false) } } + +// inputPath.walk().filter { it.extension == "md" }.forEach { source -> +// +// val docxPath = +// (outputPath / source.relativize(inputPath)).resolveSibling(source.fileName.nameWithoutExtension + ".docx") +// +// ProcessBuilder( +// "pandoc", +// "--from=markdown", +// "--to=docx", +// "--lua-filter=${scriptPath.absolute()}", +// "--output=${docxPath.absolute()}", +// "${source.absolute()}", +// +// ).also { +// logger.info("Running pandoc: ${it.command().joinToString(separator = " ")}") +// }.inheritIO().start().waitFor() +// } }