RFR: JDK-8276964: Better indicate a snippet that could not be processed [v3]
Hannes Wallnöfer
hannesw at openjdk.java.net
Tue Dec 7 14:59:41 UTC 2021
> The primary purpose of this change is to make it easier to spot invalid snippets in generated documentation.
>
> This adds a new `Content invalidTagOutput(String summary, Optional<String> detail)` method to the `TagletWriter` class that returns HTML to display the summary and optionally a detail message. The method is only used for snippet tags for now, but is generic and could be used for other invalid tags in the future.
>
> If the `detail` argument is empty or contains a blank string, a `<span>` element is returned containing the `summary` argument. If a detail argument is provided, a HTML5 `<details>` element is returned containing a `<summary>` element with the `summary` argument and a `<pre>` element containing the `details` argument. In both cases the returned element is styled with a thin border and a light red background.
>
> In its current use the `detail` argument is always provided by the message of the `ParseException` or `BadSnippetException` that was thrown and caught.
>
> Example output is available here: http://cr.openjdk.java.net/~hannesw/8276964/api.01/snippet_errormessages/A.html
>
> I added output checks to some but not all of the negative tests. In addition I slightly reformatted `TestSnippetTag.java` to add indentation to some previously unindeted text blocks.
Hannes Wallnöfer has updated the pull request incrementally with one additional commit since the last revision:
Generate invalid tag output for other tags
-------------
Changes:
- all: https://git.openjdk.java.net/jdk/pull/6579/files
- new: https://git.openjdk.java.net/jdk/pull/6579/files/4e0344e0..95903ab5
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jdk&pr=6579&range=02
- incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=6579&range=01-02
Stats: 123 lines in 11 files changed: 84 ins; 6 del; 33 mod
Patch: https://git.openjdk.java.net/jdk/pull/6579.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/6579/head:pull/6579
PR: https://git.openjdk.java.net/jdk/pull/6579
More information about the javadoc-dev
mailing list