-
CSR
-
Resolution: Unresolved
-
P3
-
None
-
behavioral
-
minimal
-
add/remove/modify command line option
-
JDK
Summary
Add javadoc
option to enable syntax highlighting for sample code in generated documentation.
Problem
Syntax highlighting for code samples is a standard feature in documentation for programming languages. While it is possible to add syntax highlighting using the existing --add-script
and --add-stylesheet
options, there should be a one-stop solution to configure syntax highlighting for Java with a single command line option.
Solution
Add a no-argument option to enable syntax highlighting in generated documentation. Syntax highlighting will use a non-configurable color scheme crafted to work with default JavaDoc stylesheets, and support Java syntax as well as a limited number of other syntaxes such as properties files and HTML. Syntax highlighting will use the lang
attribute in snippet tags to determine the snippet syntax. For plain <pre><code>
and <pre>{@code}
tags the script will use auto-detection to determine the syntax to use, if any.
Specification
Add the following option to the Javadoc Standard Doclet:
--syntax-highlight
Enable syntax highlighting for snippets and other code samples
- csr of
-
JDK-8348282 Add option for syntax highlighting in javadoc snippets
-
- Open
-