Skip to content

jason-fox/fox.jason.splash

Repository files navigation

Splash Screen for DITA-OT

license DITA-OT 4.2 CI Coverage Status Quality Gate Status

This simple DITA-OT Plug-in automatically displays a random cat picture or xkcd comic strip as a splash screen whilst waiting for a build job to complete.

▶️ Video from DITA-OT Day 2019

Table of Contents

Install

The splash screen plug-in has been tested against DITA-OT 4.x. It is recommended that you upgrade to the latest version. The splash screen plug-in relies on the use of ANT to obtain and display the splash screen image. ANT 1.9+ is recommended. Older versions of the <get> task may fail or timeout when requesting HTTPS images.

Installing DITA-OT

The DITA-OT Splash Screen is a plug-in for the DITA Open Toolkit.

  • Full installation instructions for downloading DITA-OT can be found here.

    1. Download the dita-ot-4.2.zip package from the project website at dita-ot.org/download
    2. Extract the contents of the package to the directory where you want to install DITA-OT.
    3. Optional: Add the absolute path for the bin directory to the PATH system variable. This defines the necessary environment variable to run the dita command from the command line.
curl -LO https://github.com/dita-ot/dita-ot/releases/download/4.2/dita-ot-4.2.zip
unzip -q dita-ot-4.2.zip
rm dita-ot-4.2.zip

Installing the Plug-in

  • Run the plug-in installation command:
dita install https://github.com/jason-fox/fox.jason.splash/archive/master.zip

The dita command line tool requires no additional configuration.

Usage

Automatically displaying a splash screen when running a build job

The plugin is pre-configured to run as part of the depend.preprocess.pre build step. Running any ordinary build job will display a placeholder image, a random cat photo, an anime character or xkcd comic strip.

PATH_TO_DITA_OT/bin/dita -f pdf -o out -i document.ditamap

Invoking the splash screen directly from the Command line

Like any other transform, when invoked directly, the splash screen requires an input document. Use the splash transform to invoke the image only.

Displaying a random Cat Photo

To display a random photo from the Cat API:

PATH_TO_DITA_OT/bin/dita -f splash -i document.ditamap --splash.source=cats

Obtain a key from the Cat API to access more images. see https://thecatapi.com/#pricing

Displaying a random Dog Photo

To display a random photo from the Dog API:

PATH_TO_DITA_OT/bin/dita -f splash -i document.ditamap --splash.source=cats

Obtain a key from the Dog API to access more images. see https://thedogapi.com/#pricing

Displaying a random XKCD Comic Strip

To display a random XKCD comic strip from xkcd.com:

PATH_TO_DITA_OT/bin/dita -f splash -i document.ditamap --splash.source=xkcd

Displaying a random Anime Character

To display a random anime character from thisanimedoesnotexist.ai:

PATH_TO_DITA_OT/bin/dita -f anime -i document.ditamap --splash.source=anime

Displaying a random Placeholder Image

To display a placeholder image from picsum.photos:

PATH_TO_DITA_OT/bin/dita -f splash -i document.ditamap --splash.source=picsum

Parameter Reference

  • splash.source - Return images of a specific type
    • anime
    • cats
    • dogs
    • picsum
    • xkcd

The cfg/configuration properties file allows for further customization

  • cats.api_key - API Key for the Cat API
  • cats.api.extend - Additional parameters for the Cat API
  • dogs.api_key - API Key for the Dog API
  • dogs.api.extend - Additional parameters for the Dog API with a key
  • splash.resizer.url - Fix the image splash screen width using a resize service

Contribute

PRs accepted.

License

Apache 2.0 © 2018 - 2024 Jason Fox

The Program includes the following additional software component which was obtained under license: