Polydoclot

Combine multilingual comments in the same source — This doclet aims to generate HTML of better quality than the standard doclet, and supports a few extensions, including natural-language selection of text.


Description

This is a Java™ doclet which allows you to embed multilingual text in your JavaDoc™ comments. It also should generate cleaner HTML than the standard doclet, and allows post-processing with HTMLTidy.

Language-specific clauses appear like this:

{@lang en Submit a task for execution.}
{@lang eo Liveru taskon por plenumado.}

You can ensure that only one from a group is used as follows:

{@select {@lang eo Liveru taskon por plenumado.}
{@else Submit a task for execution.}}

This, of course, could result in a lot of documentation per code, and I've never actually tried it in practice on a real library, so it could turn out to be completely impractical. Nevertheless, I wanted to sure it was possible and available if I would ever need it, and I was planning to write a doclet with better HTML output anyway.

Other features:

  • You can mark some public methods as undocumented with an @undocumented tag.

  • Factory methods can be identified with @constructor, so they get listed with constructors.

  • An explicit @summary tag can be used instead of the implicit rules about delimiting the first line of an element description.

  • The documentation title, package groupings and contributor details can be specified in the overview. From there, they can also be subject to multilingual content selection.

  • Version-​control keywords can be extracted from their surrounding syntax.

  • The doclet generates a sitemap file compatible with the Standard-Sitemap Protocol, making navigation of the documentation easier.

  • You can pass in details of which jars a class or package is to be found in. This integrates with Jardeps.
  • The output includes a file doc-properties.xml (alongside element-list), which contains a string that can be used to determine the path of a package, class or member relative to the documentation base. External tools should read this to link into the documentation.

    The class MacroFormatter shows how to expand these format strings.

See Polydoclot for documentation on Javadoc features, and Polydoclot.getSupportedOptions() for command-line arguments. The doclet class is uk.​ac.​lancs.​polydoclot.​Polydoclot.

Example output:


An earlier attempt at writing this doclet exists, using the old Javadoc API: ssdoc It won't be supported any further. The doclet class is uk.​ac.​lancs.​scc.​i18n_doclet.​SSDoclet.

Polydoclot is a complete re-write, making use of Java 9's new doclet API, jdk.javadoc.doclet.


Sorry, this software is currently not publicly available, for… reasons.