Skip to content

Commit

Permalink
Remove legacy 2.x code
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-fox committed Mar 23, 2019
1 parent a718ee7 commit 2516678
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 218 deletions.
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ jobs:
- cp dita-ot-$DITA_OT/plugins/fox.jason.unit-test/resource/pom.xml pom.xml
- mvn clean org.eluder.coveralls:coveralls-maven-plugin:report

- stage: test
name: "Unit Tests: DITA_OT=2.5.4"
env: DITA_OT=2.5.4




92 changes: 51 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,74 +1,82 @@
# Splash Screen for DITA-OT
Splash Screen for DITA-OT
=========================

[![license](https://img.shields.io/github/license/jason-fox/fox.jason.splash.svg)](http://www.apache.org/licenses/LICENSE-2.0)
[![DITA-OT 3.2](https://img.shields.io/badge/DITA--OT-3.2-blue.svg)](http://www.dita-ot.org/3.2/)
[![DITA-OT 2.5](https://img.shields.io/badge/DITA--OT-2.5-green.svg)](http://www.dita-ot.org/2.5/) <br/>
[![DITA-OT 2.5](https://img.shields.io/badge/DITA--OT-2.5-green.svg)](http://www.dita-ot.org/2.5/)
<br/>
[![Build Status](https://travis-ci.org/jason-fox/fox.jason.splash.svg?branch=master)](https://travis-ci.org/jason-fox/fox.jason.splash)
[![Coverage Status](https://coveralls.io/repos/github/jason-fox/fox.jason.splash/badge.svg?branch=master)](https://coveralls.io/github/jason-fox/fox.jason.splash?branch=master)
[![Documentation Status](https://readthedocs.org/projects/splash-screen-plug-in-for-dita-ot/badge/?version=latest)](https://splash-screen-plug-in-for-dita-ot.readthedocs.io/en/latest/?badge=latest)

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.

# Table of Contents

- [Install](#install)
- [Installing DITA-OT](#installing-dita-ot)
- [Installing the Plug-in](#installing-the-plug-in)
- [Usage](#usage)
- [Automatically displaying a splash screen when running a build job](#automatically-displaying-a-splash-screen-when-running-a-build-job)
- [Invoking the splash screen directly from the Command line](#invoking-the-splash-screen-directly-from-the-command-line)
- [Displaying a random Cat Photo](#displaying-a-random-cat-photo)
- [Displaying a random XKCD Comic Strip](#displaying-a-random-xkcd-comic-strip)
- [Contribute](#contribute)
- [License](#license)
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.

# Install

The splash screen plug-in has been tested against [DITA-OT 3.x](http://www.dita-ot.org/download). 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.
Table of Contents
=================

## Installing DITA-OT
- [Install](#install)
* [Installing DITA-OT](#installing-dita-ot)
* [Installing the Plug-in](#installing-the-plug-in)
- [Usage](#usage)
* [Automatically displaying a splash screen when running a build job](#automatically-displaying-a-splash-screen-when-running-a-build-job)
* [Invoking the splash screen directly from the Command line](#invoking-the-splash-screen-directly-from-the-command-line)
+ [Displaying a random Cat Photo](#displaying-a-random-cat-photo)
+ [Displaying a random XKCD Comic Strip](#displaying-a-random-xkcd-comic-strip)
- [Contribute](#contribute)
- [License](#license)

- Full installation instructions for downloading DITA-OT can be found
[here](https://www.dita-ot.org/3.2/topics/installing-client.html).

1. Download the `dita-ot-3.2.zip` package from the project website at [dita-ot.org/download](https://www.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.
Install
=======

This defines the necessary environment variable to run the `dita` command from the command line.
The splash screen plug-in has been tested against [DITA-OT 3.0.x](http://www.dita-ot.org/download). 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.

```console
curl -LO https://github.com/dita-ot/dita-ot/releases/download/3.2/dita-ot-3.2.zip
unzip -q dita-ot-3.2.zip
rm dita-ot-3.2.zip
Installing DITA-OT
------------------

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

- Install the DITA-OT distribution JAR file dependencies by running `gradle install` from your clone of the [DITA-OT repository](https://github.com/dita-ot/dita-ot).

The required dependencies are installed to a local Maven repository in your home directory under `.m2/repository/org/dita-ot/dost/`.

- Run the Gradle distribution task to generate the plug-in distribution package:

```bash
./gradlew dist
```

## Installing the Plug-in
The distribution ZIP file is generated under `build/distributions`.

- Run the plug-in installation command:
Installing the Plug-in
----------------------

- Run the plug-in installation command:

```bash
dita -install https://github.com/jason-fox/fox.jason.splash/archive/v1.0.0.zip
```

The `dita` command line tool requires no additional configuration.

# Usage

## Automatically displaying a splash screen when running a build job
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.
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.

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

## Invoking the splash screen directly from the Command line
Invoking the splash screen directly from the Command line
---------------------------------------------------------

Like any other transform, when invoked directly, the splash screen requires an input document

Expand All @@ -88,14 +96,16 @@ To display a random XKCD comic strip from [xkcd.com](https://xkcd.com/), use the
PATH_TO_DITA_OT/bin/dita -f xkcd -i document.ditamap
```

# Contribute
Contribute
==========

PRs accepted.

# License
License
=======

[Apache 2.0](LICENSE) © 2018 Jason Fox

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

- Ant-Swing.jar - https://ant.apache.org/ - **Apache 2.0 license**
* Ant-Swing.jar - https://ant.apache.org/ - **Apache 2.0 license**
25 changes: 8 additions & 17 deletions build_dita2splash.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,16 @@
<pathelement location="${dita.dir}/lib/ant.jar"/>
</path>
<tempfile deleteonexit="true" destdir="${dita.temp.dir}" property="splash.info.file"/>
<condition property="otversion.legacy">
<matches pattern="^[1|2].*" string="${otversion}"/>
</condition>
<macrodef name="splash-log">
<attribute name="id"/>
<attribute name="message"/>
<attribute name="level"/>
<sequential>
<dita-ot-echo id="@{id}" unless:set="otversion.legacy">
<param name="1" value="@{message}"/>
</dita-ot-echo>
<echo if:set="otversion.legacy" level="@{level}" message="@{message}" taskname="@{id}"/>
</sequential>
</macrodef>
</target>
<!--
Make an HTTP request to the Cats API - check we are online and can obtain an image.
For more information see: http://thecatapi.com/docs.html
-->
<target name="cats.init">
<splash-log id="CATS001I" level="info" message="Requesting image from the Cats API."/>
<dita-ot-echo id="CATS001I" unless:set="otversion.legacy">
<param name="1" value="Requesting image from the Cats API."/>
</dita-ot-echo>

<get dest="${splash.info.file}" ignoreerrors="true" retries="1" src="https://thecatapi.com/api/images/get?format=xml&amp;type=jpg,gif&amp;size=med"/>
<condition property="splash.exists" value="true">
<and>
Expand Down Expand Up @@ -70,7 +59,9 @@
For more information see: https://xkcd.com/json.html
-->
<target name="xkcd.init">
<splash-log id="XKCD001I" level="info" message="Requesting image from XKCD API."/>
<dita-ot-echo id="XKCD001I">
<param name="1" value="Requesting image from XKCD API."/>
</dita-ot-echo>
<get dest="${splash.info.file}" ignoreerrors="true" retries="1" src="https://xkcd.com/info.0.json"/>
<condition property="splash.exists" value="true">
<and>
Expand Down Expand Up @@ -140,4 +131,4 @@
-->
<target depends="xkcd.splash" name="dita2xkcd"/>
<target depends="cats.splash" name="dita2cats"/>
</project>
</project>
145 changes: 0 additions & 145 deletions build_dita2splash_template.xml

This file was deleted.

3 changes: 0 additions & 3 deletions conductor.xml

This file was deleted.

10 changes: 2 additions & 8 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,13 @@
This file is part of the DITA-OT Splash Screen Plug-in project.
See the accompanying LICENSE file for applicable licenses.
-->
<plugin id="fox.jason.splash">
<!--
Define package details.
-->
<feature extension="package.version" value="1.0.2"/>
<plugin id="fox.jason.splash" version="2.0.0">
<!--feature extension="depend.preprocess.pre" value="display-xkcd"/-->
<feature extension="depend.preprocess.pre" value="cats.splash"/>
<feature extension="dita.xsl.messages" file="resource/messages.xml"/>
<feature extension="dita.conductor.transtype.check" value="xkcd"/>
<transtype abstract="false" desc="Display a random xkcd comic as a splash screen" name="xkcd"/>
<feature extension="dita.conductor.transtype.check" value="cats"/>
<transtype abstract="false" desc="Display a random cat picture as a splash screen" name="cats"/>
<!--feature extension="ant.import" file="build_dita2splash.xml"/-->
<feature extension="dita.conductor.target.relative" file="conductor.xml"/>
<template file="build_dita2splash_template.xml"/>
<feature extension="ant.import" file="build_dita2splash.xml"/>
</plugin>

0 comments on commit 2516678

Please sign in to comment.