Hi folks,

The groovydoc tool hasn't had many updates in a while, so I thought I'd try
to change that. There is now a new version featuring:

* snippets (mimicking JEP 413) and markdown doc-comment rendering
(mimicking JEP 467)
* customisable syntax highlighting with some dark/light mode support
*  new commandline/Ant config options: showInternal, noIndex,
noDeprecatedList, noHelp, syntaxHighlighter, theme, addStylesheet,
additionalStylesheets, preLanguage
* new tags supported: @snippet, @highlight, @replace, @link (changed),
@start, @end, @apiNote, @implSpec, @implNote, @value, @param (changed),
@inheritDoc

A nice thing about the snippet and markdown support is that it works for
JDK17+ for Java and Groovy files, instead of JDK18 (snippets) and JDK23
(markdown) when using javadoc.

I merged the PR with only a short time for review because of the next topic
(Gradle support) meaning that most folks wouldn't have been able to test it
anyway. So commit then review seemed the only realistic option. I can
easily back out any bits that folks aren't happy with.

Gotchas using Gradle's Groovydoc task

The `org.gradle.api.tasks.javadoc.Groovydoc` task type shipped with Gradle
predates all the improvements above, so the following settings are NOT
available via
the built-in task's DSL:

 - javaVersion
 - showInternal
 - noIndex, noDeprecatedList, noHelp
 - syntaxHighlighter
 - theme
 - addStylesheet / additionalStylesheets
 - preLanguage

Setting any of those on a Gradle `Groovydoc` task has no effect. Gradle
does use Groovy's Ant task under the hood, but only passes through the
older property set.

For our own Groovydoc needs, we have borrowed a copy of the Groovydoc task
from Grails, which gives us access to all the new features. At some point
we need to speak with them about maybe releasing this as an official Gradle
plugin.

Let me know if you have any problems or suggestions for improvement.

Cheers, Paul.

Reply via email to