https://github.com/jason-fox/fox.jason.passthrough
Abstract base DITA-OT Plug-in to enable files to bypass DITA-OT pre-processing
https://github.com/jason-fox/fox.jason.passthrough
dita-ot dita-ot-plugin
Last synced: about 1 year ago
JSON representation
Abstract base DITA-OT Plug-in to enable files to bypass DITA-OT pre-processing
- Host: GitHub
- URL: https://github.com/jason-fox/fox.jason.passthrough
- Owner: jason-fox
- License: apache-2.0
- Created: 2019-07-19T18:37:59.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-02-18T07:43:36.000Z (over 2 years ago)
- Last Synced: 2025-02-13T04:44:11.847Z (over 1 year ago)
- Topics: dita-ot, dita-ot-plugin
- Language: Java
- Homepage: https://jason-fox.github.io/dita-ot-plugins/passthrough
- Size: 331 KB
- Stars: 1
- Watchers: 0
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pass Through Plugin for DITA-OT [
](http://passthroughdita-ot.rtfd.io/)
[](http://www.apache.org/licenses/LICENSE-2.0)
[](http://www.dita-ot.org/4.2)
[](https://github.com/jason-fox/fox.jason.passthrough/actions?query=workflow%3ACI)
[](https://sonarcloud.io/dashboard?id=fox.jason.passthrough)
This is an abstract base [DITA-OT Plug-in](https://www.dita-ot.org/plugins) to enable files to bypass DITA-OT
pre-processing and be copied directly over into the processing directory. It is designed to be extended.
The plugin consists of a no-op file reader and an Antlib library. It offers two extension-points for further processing.
Table of Contents
- [Install](#install)
- [Installing DITA-OT](#installing-dita-ot)
- [Installing the Plug-in](#installing-the-plug-in)
- [Usage](#usage)
- [Extension points](#extension-points)
- [Example](#example)
- [API](#api)
- [Passthrough-Iterate](#passthrough-iterate)
- [License](#license)
## Install
The DITA-OT Passthrough 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.
### Installing DITA-OT
The DITA-OT Pass Through plug-in is a file reader for the DITA Open Toolkit.
- Full installation instructions for downloading DITA-OT can be found
[here](https://www.dita-ot.org/4.0/topics/installing-client.html).
1. Download the `dita-ot-4.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.
This defines the necessary environment variable to run the `dita` command from the command line.
```console
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 commands:
```console
dita install https://github.com/jason-fox/fox.jason.passthrough/archive/master.zip
```
The `dita` command line tool requires no additional configuration.
---
## Usage
To mark a file as requiring no processing, label it with `format="passthrough"` within the `*.ditamap` as shown:
```xml
...etc
```
The additional file will be added to the build job without processing.
### Extension points
This plug-in is designed to be extended and offers two extension points:
- `passthrough.pre` - Runs an additional Ant target before the passthrough pre-processing stage.
- `passthrough.process` - Runs an additional Ant target as part of the passthrough processing stage.
#### Example
The following `plugin.xml` will enable the post-processing of all files marked as `format=NEW_FORMAT`
##### `plugin.xml` Configuration
```xml
```
##### ANT build file
```xml
```
A working example can be found in the [DITA-OT Pandoc plug-in](https://github.com/jason-fox/fox.jason.pandoc)
repository.
## API
The following ANT task is available from the DITA-OT Pass through plug-in
### Passthrough-Iterate
#### Description
Post process all files of a given format using the macro supplied
#### Parameters
| Attribute | Description | Required |
| --------- | ------------------------------------------------ | -------- |
| format | The `format` attribute used with the `*.ditamap` | Yes |
| macro | The name of the `` to run | Yes |
#### Example
```xml
```
Files marked as `format="NEW_FORMAT"` should be processed by the `macrodef` called `do-something`. The macro must offer
an interface with `src`, `dest`, `title` and `metadata` attributes.
## License
[Apache 2.0](LICENSE) © 2019 - 2024 Jason Fox