refactor(help): refactor
@@ -69,7 +69,7 @@ open class GenerateDocsTask : DefaultTask() {
}
private fun createContentMarkdownFromTemplate(templatesDir: File, contentDir: File, templateFile: File, baseOutputDir: File, templateProvider: TemplateProvider, helpContentTerms: Terms) {
- val helpContentTemplateRelativePath = deriveTemplateRelativePath(templatesDir, templateFile)
+ val helpContentTemplateRelativePath = templateFile.toRelativeString(templatesDir)
val outputFile = deriveOutputFileForContentTemplate(contentDir, templateFile, baseOutputDir)
println("Generating markdown from template file: ${helpContentTemplateRelativePath} --> ${outputFile.canonicalPath}")
createFromFreemarker(templateProvider, helpContentTemplateRelativePath, outputFile, helpContentTerms.termMap)
@@ -82,10 +82,6 @@ open class GenerateDocsTask : DefaultTask() {
return outputFile
}
- private fun deriveTemplateRelativePath(templatesDir: File, templateFile: File): String {
- return templateFile.toRelativeString(templatesDir)
- }
-
private fun createFromFreemarker(templateProvider: TemplateProvider, outputDir: File, templateName: String, data: Any) {
createFromFreemarker(templateProvider, "$templateName.ftl", File(outputDir, "$templateName.md"), data);
}
