Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Java 11 (rebased) #108

Merged
merged 2 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
target
tmp
out
dependency-reduced-pom.xml
3 changes: 3 additions & 0 deletions .sdkmanrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Enable auto-env through the sdkman_auto_env config
# Add key=value pairs of SDKs to use below
java=11.0.20-tem
49 changes: 30 additions & 19 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,21 @@ ifdef::env-github[]
:badges:
:!toc-title:
endif::[]
:release-version: 1.5.6
// Refs
:asciidoclet-version: 1.5.6
:asciidoclet-src-ref: https://github.com/asciidoctor/asciidoclet
:asciidoclet-javadoc-ref: https://www.javadoc.io/doc/org.asciidoctor/asciidoclet/{asciidoclet-version}
:asciidoclet-javadoc-ref: https://oss.sonatype.org/service/local/repositories/releases/archive/org/asciidoctor/asciidoclet/1.5.2/asciidoclet-1.5.2-javadoc.jar/!/index.html
:asciidoclet-release-ref: https://asciidoctor.org/news/2014/09/09/asciidoclet-1.5.0-released/
:asciidoc-ref: https://asciidoc.org
:asciidoctor-java-ref: https://asciidoctor.org/docs/install-and-use-asciidoctor-java-integration/
:asciidoclet-issues-ref: https://github.com/asciidoctor/asciidoclet/issues
:asciidoctor-src-ref: https://github.com/asciidoctor/asciidoctor
:asciidoctor-java-src-ref: https://github.com/asciidoctor/asciidoctor-java-integration
:discuss-ref: https://discuss.asciidoctor.org/
:discuss-ref: https://chat.asciidoctor.org

ifdef::badges[]
image:https://img.shields.io/badge/javadoc.io-{asciidoclet-version}-blue.svg[Javadoc, link={asciidoclet-javadoc-ref}]
image:https://img.shields.io/travis/asciidoctor/asciidoclet/master.svg["Build Status", link="https://travis-ci.org/asciidoctor/asciidoclet"]
image:https://img.shields.io/badge/javadoc.io-{release-version}-blue.svg[Javadoc, link=https://www.javadoc.io/doc/org.asciidoctor/asciidoclet/{release-version}]
endif::[]

{asciidoclet-src-ref}[Asciidoclet] is a Javadoc Doclet based on Asciidoctor that lets you write Javadoc in the AsciiDoc syntax.
Expand All @@ -39,9 +40,9 @@ endif::[]

Traditionally, Javadocs have mixed minor markup with HTML which, if you're writing for HTML Javadoc output, becomes unreadable and hard to write over time.
This is where lightweight markup languages like {asciidoc-ref}[AsciiDoc] thrive.
AsciiDoc straddles the line between readable markup and beautifully rendered content.
AsciiDoc straddles the line between readable markup and beautifully converted content.

Asciidoclet incorporates an AsciiDoc renderer (Asciidoctor via the {asciidoctor-java-ref}[Asciidoctor Java integration] library) into a simple Doclet that enables AsciiDoc formatting within Javadoc comments and tags.
Asciidoclet incorporates an AsciiDoc converter (Asciidoctor via the {asciidoctor-java-ref}[Asciidoctor Java integration] library) into a simple Doclet that enables AsciiDoc formatting within Javadoc comments and tags.

== Example

Expand Down Expand Up @@ -102,12 +103,12 @@ public class Asciidoclet extends Doclet {
}
----

The result is readable source and beautifully rendered Javadocs, the best of both worlds!
The result is readable source and beautifully converted Javadocs, the best of both worlds!

// tag::usage[]
== Usage

Run Javadoc with the `org.asciidoctor.Asciidoclet` doclet class.
Run Javadoc with the `org.asciidoctor.asciidoctlet.Asciidoclet` doclet class.
Some examples for common build systems are shown below.
See <<doclet-options>> for supported options.

Expand All @@ -120,10 +121,14 @@ Asciidoclet may be used via a `maven-javadoc-plugin` doclet:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9</version>
<version>3.6.3</version>
<configuration>
<source>1.7</source>
<doclet>org.asciidoctor.Asciidoclet</doclet>
<source>11</source>
<additionalJOptions>
<additionalJOption>-J--add-exports=jdk.javadoc/jdk.javadoc.internal.tool=ALL-UNNAMED</additionalJOption> // <1>
<additionalJOption>-Xdoclint:all,-html,-accessibility</additionalJOption> // <2>
</additionalJOptions>
<doclet>org.asciidoctor.asciidoclet.Asciidoclet</doclet>
<docletArtifact>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoclet</artifactId>
Expand All @@ -139,6 +144,10 @@ Asciidoclet may be used via a `maven-javadoc-plugin` doclet:
</configuration>
</plugin>
----
<1> For the asciidoclet to work, it needs access to the internals of the `javadoc` tool.
This incantation makes that access possible on moduler JDKs.
<2> Asciidoctor may generate HTML that produces doclint errors, which can cause the build to fail.
To work around that, we have to disable these doclint categories.

=== Gradle

Expand All @@ -156,7 +165,7 @@ dependencies {

javadoc {
options.docletpath = configurations.asciidoclet.files.asType(List)
options.doclet = 'org.asciidoctor.Asciidoclet'
options.doclet = 'org.asciidoctor.asciidoclet.Asciidoclet'
options.overview = "src/main/java/overview.adoc"
options.addStringOption "-base-dir", "${projectDir}" // <1>
options.addStringOption "-attribute", // <2>
Expand All @@ -179,7 +188,7 @@ Asciidoclet may be used via a doclet element in Ant's `javadoc` task:
<javadoc destdir="target/javadoc"
sourcepath="src"
overview="src/overview.adoc">
<doclet name="org.asciidoctor.Asciidoclet" pathref="asciidoclet.classpath"> <!--1-->
<doclet name="org.asciidoctor.asciidoclet.Asciidoclet" pathref="asciidoclet.classpath"> <!--1-->
<param name="--base-dir" value="${basedir}"/>
<param name="--attribute" value="name=${ant.project.name}"/>
<param name="--attribute" value="version=${version}"/>
Expand Down Expand Up @@ -242,20 +251,22 @@ Other files are assumed to be HTML and will be processed by the standard doclet.
--asciidoclet-include <filter>::
--asciidoclet-exclude <filter>::
Explicitly include or exclude classes from being processed as Asciidoc comments by ant-style path matching (see https://github.com/azagniotov/ant-style-path-matcher[ant-style-path-matcher]).
+
If `--asciidoclet-include` is specified, only classes and packages matching the include filter are processed.
Likewise, if `--include` is unspecified, all classes are processed.
If `--asciidoclet-exclude` is specified, classes specifically matching the filter are not processed.
`--asciidoclet-include` and `--asciidoclet-exclude` can be mixed.
If `--asciidoclet-exclude` is specified, classes matching the filter are not processed.
+
Both `--asciidoclet-include` and `--asciidoclet-exclude` can be mixed.
In addition, classes excluded with `--asciidoclet-exclude` or not matching a specified `--asciidoclet-include` may be included by annotating the class level javadoc with `@asciidoclet`.
Doing so allows the ability to write one class at a time while respecting refactors.
This feature allows the migration of documentation from HTML to Asciidoc in a piecemeal way
Doing so allows writing one class at a time while respecting refactors.
This feature allows the migration of documentation from HTML to Asciidoc in a piecemeal way.

// end::doclet-options[]
// end::usage[]

=== Log Warning

Currently there is a intermittent benign warning message that is emitted during a run of Asciidoclet stating the following:
Currently, there is an intermittent benign warning message that is emitted during a run of Asciidoclet stating the following:

....
WARN: tilt autoloading 'tilt/haml' in a non thread-safe way; explicit require 'tilt/haml' suggested.
Expand All @@ -278,7 +289,7 @@ For more information:
* {asciidoctor-src-ref}[Asciidoctor Source Code]
* {asciidoctor-java-src-ref}[Asciidoctor Java Integration Source Code]

If you have questions or would like to help develop this project, please join the {discuss-ref}[Asciidoctor discussion list].
If you have questions or would like to help develop this project, please join the {discuss-ref}[Asciidoctor Chat].

ifndef::env-site[]
== Powered by Asciidoclet
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/getting-started.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Traditionally, Javadocs have mixed minor markup with HTML which, if you're writi
This is where lightweight markup languages like {asciidoc-ref}[AsciiDoc] thrive.
AsciiDoc straddles the line between readable markup and beautifully rendered content.

Asciidoclet incorporates an AsciiDoc renderer (Asciidoctor via the {asciidoctor-java-ref}[Asciidoctor Java integration] library) into a simple Doclet that enables AsciiDoc formatting within Javadoc comments and tags.
Asciidoclet incorporates an AsciiDoc converter (Asciidoctor via the {asciidoctor-java-ref}[Asciidoctor Java integration] library) into a simple Doclet that enables AsciiDoc formatting within Javadoc comments and tags.

== Example

Expand Down
13 changes: 13 additions & 0 deletions docs/modules/ROOT/pages/options.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,16 @@ This option is only needed when using the `--require` option to load additional
Overview documentation can be generated from an Asciidoc file using the standard `-overview` option.
Files matching [x-]`*.adoc`, [x-]`*.ad`, [x-]`*.asciidoc` or [x-]`*.txt` are processed by Asciidoclet.
Other files are assumed to be HTML and will be processed by the standard doclet.

--asciidoclet-include <filter>::
--asciidoclet-exclude <filter>::
Explicitly include or exclude classes from being processed as Asciidoc comments by ant-style path matching (see https://github.com/azagniotov/ant-style-path-matcher[ant-style-path-matcher]).
+
If `--asciidoclet-include` is specified, only classes and packages matching the include filter are processed.
Likewise, if `--include` is unspecified, all classes are processed.
If `--asciidoclet-exclude` is specified, classes matching the filter are not processed.
+
Both `--asciidoclet-include` and `--asciidoclet-exclude` can be mixed.
In addition, classes excluded with `--asciidoclet-exclude` or not matching a specified `--asciidoclet-include` may be included by annotating the class level javadoc with `@asciidoclet`.
Doing so allows writing one class at a time while respecting refactors.
This feature allows the migration of documentation from HTML to Asciidoc in a piecemeal way.
8 changes: 4 additions & 4 deletions docs/modules/ROOT/pages/usage.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ Asciidoclet may be used via a `maven-javadoc-plugin` doclet:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9</version>
<version>3.6.3</version>
<configuration>
<source>1.7</source>
<doclet>org.asciidoctor.Asciidoclet</doclet>
<source>11</source>
<doclet>org.asciidoctor.asciidoclet.Asciidoclet</doclet>
<docletArtifact>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoclet</artifactId>
Expand Down Expand Up @@ -91,7 +91,7 @@ using https://ant.apache.org/ivy/[Ivy^] or similar.
// tag::warning-message[]
[WARNING]
====
Currently there is a intermittent benign warning message that is emitted during a run of Asciidoclet stating the following:
Currently, there is an intermittent benign warning message that is emitted during a run of Asciidoclet stating the following:

WARN: tilt autoloading 'tilt/haml' in a non thread-safe way; explicit require 'tilt/haml' suggested.

Expand Down
4 changes: 2 additions & 2 deletions docs/modules/project/pages/powered-by-asciidoclet.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
|https://github.com/johncarl81/parceler[johncarl81/parceler]
|https://oss.sonatype.org/service/local/repositories/releases/archive/org/parceler/parceler-api/1.1.10/parceler-api-1.1.10-javadoc.jar/!/index.html[JavaDoc jar]

|http://github.com/JGrenier/asciidoclet-sample[asciidoclet-sample]
|http://github.com/JGrenier/asciidoclet-sample[JGrenier/asciidoclet-sample]
|https://github.com/JGrenier/asciidoclet-sample[asciidoclet-sample]
|https://github.com/JGrenier/asciidoclet-sample[JGrenier/asciidoclet-sample]
|Not available

|https://consensusj.github.io/consensusj[ConsensusJ]
Expand Down
Loading
Loading