docbook-apps

How do I generate a PDF through the gradle DocBookTask

  • 1.  How do I generate a PDF through the gradle DocBookTask

    Posted 02-13-2019 21:22
    I found Norm Walsh’s grade DocBookTask in his article https://so.nwalsh.com/2018/03/05/easy <https://so.nwalsh.com/2018/03/05/easy>

    It shows the creation of HTML from DocBook. I need to know the build.gradle file specification for generating a PDF from my DocBook file.

    The build.gradle in the article is:

    buildscript {
    repositories {
    mavenCentral()
    maven { url "http://maven.restlet.org" }
    }

    dependencies {
    classpath group: 'org.docbook', name: 'docbook-xslt2', version: '2.2.0'
    classpath group: 'com.xmlcalabash', name: 'xmlcalabash1-gradle', version: '1.3.2'
    classpath group: 'org.xmlresolver', name: 'xmlresolver', version: '0.13.1'
    // Add this line:
    classpath group: 'org.docbook', name: 'docbook-schemas', version: '5.1-1'
    }
    }

    import org.docbook.DocBookTask
    import com.xmlcalabash.XMLCalabashTask

    task myDocument(type: DocBookTask) {
    // And tell the pipeline to validate with the schema
    option("schema", "https://docbook.org/xml/5.1/rng/docbook.rng")
    input("source", "document.xml")
    output("result", "output.html")
    }

    I need to find the settings for generating a PDF.

    Thanks,
    Loren Cahlander