Splash Screen Plug-in

This simple DITA-OT plug-in automatically displays a random cat picture from the Cat API, an xkcd comic strip, a random anime character from This anime does not exist, or a placeholder image from picsum.photos as a splash screen whilst waiting for a build job to complete.

Examples

The Cat API

The Cat API was created by Aden Forshaw back in 2012 as a way to give back and help teach people to code, it’s now been used by thousands of App developers making all sorts of weird & wonderful creations.

It allows anyone to build apps that search for Cat images, upload their own, vote or favourite them, and to allow their users to do the same.

It’s completely free to use & primarily a learning tool to teach anyone the basics of using APIs in a fun & interesting way. Perfect for classrooms, hackathons, or weekend side projects.

Figure 1. Image from Cat API

XKCD

xkcd, sometimes styled XKCD is a webcomic created by Randall Munroe. The comic’s tagline describes it as "A webcomic of romance, sarcasm, math, and language". Munroe states on the comic’s website that the name of the comic is not an initialism but "just a word with no phonetic pronunciation".

The subject matter of the comic varies from statements on life and love to mathematical, programming, and scientific in-jokes. Some strips feature simple humor or pop-culture references. Although it has a cast of stick figures, the comic occasionally features landscapes, graphs and charts, and intricate mathematical patterns such as fractals. New cartoons are added three times a week, on Mondays, Wednesdays, and Fridays.

Figure 2. Image from XKCD

This Anime does not Exist

This Anime Does Not Exist was launched on January 19th 2021, showcasing almost a million images (n=900,000 at launch, now n=1,800,000 images), every single one of which was generated by Aydao‘s Stylegan2 model.

A blog post is available discussing the website itself, thisanimedoesnotexist.ai, including more images, videos, and statistics.

Figure 3. Image from This Anime Does not exist API

Lorem Picsum

Lorem Picsum describes itself as the Lorem Ipsum for photos

It generates random stylish placeholder images based on desired image size (width and height) generated from a baseline set of images.

Figure 4. Image from Lorem Picsum

Install

This is a standalone plug-in without dependencies which can be installed from the command line.

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.

Run the plug-in installation commands:

dita install https://github.com/jason-fox/fox.jason.splash/archive/master.zip

The dita command line tool requires no additional configuration.

To switch to displaying XKCD images, amend the pom.xml within the plug-in directly and replace the line <feature extension="depend.preprocess.pre" value="cats.splash"/> with <feature extension="depend.preprocess.pre" value="xkcd.splash"/>.

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 random cat photo.

dita --format pdf \
    --output out \
    --input document.ditamap

Displaying a random Cat Photo

To display a random photo from the Cat API, use the cats transform.

dita --format cats \
    --input document.ditamap

Displaying a random XKCD Comic Strip

To display a random XKCD comic strip from xkcd.com, use the xkcd transform.

dita --format xkcd \
    --input document.ditamap

Displaying a random anime character

To display a random anime character from thisanimedoesnotexist.ai, use the anime transform.

dita --format anime \
    --input document.ditamap

Displaying a random placeholder image

To display a random placeholder image from picsum.photos, use the picsum transform.

dita --format picsum \
    --input document.ditamap