Skip to content

Commit

Permalink
Tidy up README
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-fox committed Apr 30, 2020
1 parent 70057b5 commit 362bc7c
Showing 1 changed file with 23 additions and 16 deletions.
39 changes: 23 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
[![Coverage Status](https://coveralls.io/repos/github/jason-fox/fox.jason.passthrough.javadoc/badge.svg?branch=master)](https://coveralls.io/github/jason-fox/fox.jason.passthrough.javadoc?branch=master)
[![Documentation Status](https://readthedocs.org/projects/javadocdita-ot/badge/?version=latest)](https://javadocdita-ot.readthedocs.io/en/latest/?badge=latest)

This is a [DITA-OT Plug-in](https://www.dita-ot.org/plugins) used to auto-create valid DITA-based JavaDoc documentation. The initial source of the documentation can be
generated directly using the [JavaDoc XML Doclet](https://github.com/MarkusBernhardt/xml-doclet). The XML file can be added to the source and processed as if it had been written
in DITA.
This is a [DITA-OT Plug-in](https://www.dita-ot.org/plugins) used to auto-create valid DITA-based JavaDoc documentation.
The initial source of the documentation can be generated directly using the
[JavaDoc XML Doclet](https://github.com/MarkusBernhardt/xml-doclet). The XML file can be added to the source and
processed as if it had been written in DITA.

<details>
<summary><strong>Table of Contents</strong></summary>
Expand All @@ -26,12 +27,16 @@ in DITA.

[<img src="https://jason-fox.github.io/fox.jason.passthrough.javadoc/javalogo.png" align="right" height="55">](https://docs.oracle.com/javase/1.5.0/docs/guide/javadoc/index.html)

[JavaDoc](https://docs.oracle.com/javase/1.5.0/docs/guide/javadoc/index.html) is a tool that parses the declarations and documentation comments in a set of source files and produces a set of HTML pages describing the classes, interfaces, constructors, methods, and fields.
[JavaDoc](https://docs.oracle.com/javase/1.5.0/docs/guide/javadoc/index.html) is a tool that parses the declarations and
documentation comments in a set of source files and produces a set of HTML pages describing the classes, interfaces,
constructors, methods, and fields.

JavaDoc supports doclets used to customize JavaDoc output. A doclet is a program written with the Doclet API that specifies the content and format of the output to be generated by the Javadoc tool.
JavaDoc supports doclets used to customize JavaDoc output. A doclet is a program written with the Doclet API that
specifies the content and format of the output to be generated by the Javadoc tool.

A library exists to preprocess JavaDoc comments from Java source code to a XML document. It can be downloaded [here](https://github.com/MarkusBernhardt/xml-doclet). This DITA-OT plugin processes a JavaDoc XML and the converts it to DITA allowing the generation of PDF API
documentation.
A library exists to preprocess JavaDoc comments from Java source code to a XML document. It can be downloaded
[here](https://github.com/MarkusBernhardt/xml-doclet). This DITA-OT plugin processes a JavaDoc XML and the converts it
to DITA allowing the generation of PDF API documentation.

#### Sample JavaDoc

Expand All @@ -54,13 +59,13 @@ public interface Effector {

#### Sample DITA Output

> ![](https://jason-fox.github.io/fox.jason.passthrough.javadoc/javadoc-output.png)
> ![](https://jason-fox.github.io/fox.jason.passthrough.javadoc/javadoc-output.png)
## Install

The DITA-OT JavaDoc plug-in has been tested against [DITA-OT 3.x](http://www.dita-ot.org/download). The plugin requires the XSLT 3.0 support
found in the [Saxon9.8HE](https://www.saxonica.com/html/download/java.html) library, so the mimimum DITA-OT version is therefore 3.3.
It is recommended that you upgrade to the latest version.
The DITA-OT JavaDoc plug-in has been tested against [DITA-OT 3.x](http://www.dita-ot.org/download). The plugin requires
the XSLT 3.0 support found in the [Saxon9.8HE](https://www.saxonica.com/html/download/java.html) library, so the mimimum
DITA-OT version is therefore 3.3. It is recommended that you upgrade to the latest version.

### Installing DITA-OT

Expand Down Expand Up @@ -100,7 +105,8 @@ The `dita` command line tool requires no additional configuration.

## Usage

If you are using maven you can generate XML-based JavaDoc by adding the following plug-in to your `pom.xml`. JavaDoc will be generated using the `mvn package` command.
If you are using maven you can generate XML-based JavaDoc by adding the following plug-in to your `pom.xml`. JavaDoc
will be generated using the `mvn package` command.

```xml
<project>
Expand Down Expand Up @@ -132,16 +138,18 @@ If you are using maven you can generate XML-based JavaDoc by adding the followin
</project>
```

If you are not using maven, you can use the [jar-with-dependencies](http://search.maven.org/remotecontent?filepath=com/github/markusbernhardt/xml-doclet/1.0.5/xml-doclet-1.0.5-jar-with-dependencies.jar), which contains all required libraries.
If you are not using maven, you can use the
[jar-with-dependencies](http://search.maven.org/remotecontent?filepath=com/github/markusbernhardt/xml-doclet/1.0.5/xml-doclet-1.0.5-jar-with-dependencies.jar),
which contains all required libraries.

```console
javadoc -doclet com.github.markusbernhardt.xmldoclet.XmlDoclet \
-docletpath xml-doclet-1.0.5-jar-with-dependencies.jar \
[Javadoc- and XmlDoclet-Options]
```

Once the source XML has been created, add it to the `*.ditamap` and mark it for **JavaDoc** processing,
by labelling it with `format="javadoc"` within the `*.ditamap` as shown:
Once the source XML has been created, add it to the `*.ditamap` and mark it for **JavaDoc** processing, by labelling it
with `format="javadoc"` within the `*.ditamap` as shown:

```xml
<?xml version="1.0" encoding="UTF-8"?>
Expand All @@ -163,7 +171,6 @@ The additional file will be converted to a `*.dita` file and will be added to th
Unless overridden, the `navtitle` of the included topic will be the same as root name of the file. Any underscores in
the filename will be replaced by spaces in title.


## License

[Apache 2.0](LICENSE) © 2019 - 2020 Jason Fox
Expand Down

0 comments on commit 362bc7c

Please sign in to comment.