1 minute to read
generateDocbook
At a Glance
About This Task
A helper task, generateDocbook generates the intermediate format for convertToDocx
<<>> and convertToEpub
.
Source
AsciiDocBasics.gradle
task generateDocbook (
type: AsciidoctorTask,
group: 'docToolchain',
description: 'use docbook as asciidoc backend') {
def sourceFilesDOCBOOK = findSourceFilesByType(['docbook', 'epub', 'docx'])
// onlyIf {
// sourceFilesDOCBOOK
// }
sources {
sourceFilesDOCBOOK.each {
include it.file
logger.info it.file
File useFile = new File(srcDir, it.file)
if (!useFile.exists()) {
throw new Exception ("""
The file $useFile in DOCBOOK config does not exist!
Please check the configuration 'inputFiles' in $mainConfigFile.""")
}
}
}
outputOptions {
backends = ['docbook']
}
outputDir = file(targetDir+'/docbook/')
doFirst {
if (sourceFilesDOCBOOK.size()==0) {
throw new Exception ("""
>> No source files defined for type of '[docbook, epub, docx]'.
>> Please specify at least one inputFile in your docToolchainConfig.groovy
""")
}
}
}
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.