Giter Site home page Giter Site logo

dita-ot-gradle's Introduction

DITA-OT Gradle Plugin

A Gradle plugin for publishing DITA documents with DITA Open Toolkit.

Use

In your Gradle build script (build.gradle), add something like this:

plugins {
    id 'com.github.eerohele.dita-ot-gradle' version '0.7.1'
}

// Publish my.ditamap into the HTML5 output format.
dita {
    ditaOt '/path/to/my/dita-ot/directory'
    input 'my.ditamap'
    transtype 'html5'
}

Then, in the directory where you saved the file, run:

gradle dita

By default, the output appears in the build subdirectory.

Features

  • After the first build, (much) faster than running DITA-OT directly, thanks to the Gradle Daemon.
  • Easy to configure.
  • Versatile: publish multiple documents at once.
  • Incremental builds: only build DITA documents that have changed.
  • Continuous builds: automatically republish your document when it changes (Gradle's --continuous option).

Examples

To get started, see the simple example buildfile.

For more examples, see the examples directory in this repository.

You're most welcome to contribute improvements on the current set of examples or entirely new examples.

Downloading DITA Open Toolkit

You can use the Gradle Download Task to download DITA-OT and use the downloaded version in your build. See the download example for an example.

Options

Type Option Description
String or File input The input file.
String or File output The output directory. Default: build.
String... transtype One or more formats to publish into.
String or File filter Path to DITAVAL file to use for publishing.
Boolean singleOutputDir Multiple input files โžž single output directory. Default: false.
Boolean useAssociatedFilter For every input file, use DITAVAL file in same directory with same basename. Default: false.

Passing Ant properties to DITA-OT

To pass an Ant property to DITA-OT, use the properties block. For example:

// Give DITA-OT additional parameters.
//
// For a list of the parameters DITA-OT understands, see:
// http://www.dita-ot.org/2.1/parameters/
properties {
    property(name: 'processing-mode', value: 'strict')
}

If your Ant properties are paths (such as args.cssroot), you need to use absolute paths. If the path is under the same directory as build.gradle, you can use the projectDir variable:

properties {
    // Note the double quotes around the value; with single quotes,
    // the projectDir variable won't be expanded.
    property(name: 'args.cssroot', value: "${projectDir}/my/awesome/path")
}

License

The DITA-OT Gradle Plugin is licensed for use under the Apache License 2.0.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.