Skip to content

Commit 87b0afc

Browse files
Enable syntax highlighting for javadoc code blocks using JDK 25
Upgrade javadoc toolchain from JDK 23 to JDK 25 to use the new `--syntax-highlight` option, which bundles highlight.js for automatic syntax highlighting of fenced code blocks in markdown documentation. - Update `javadoc.jdk.version` from 23 to 25 in `pom.xml` - Add `--syntax-highlight` option to maven-javadoc-plugin configuration - Update CI workflows to set up JDK 25 for javadoc generation - Update contributor documentation with syntax highlighting details 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent f3e1bb5 commit 87b0afc

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
- name: Checkout source code
1313
uses: actions/checkout@v4
1414

15-
- name: Set up JDK 23 for Javadoc toolchain
15+
- name: Set up JDK 25 for Javadoc toolchain
1616
uses: actions/setup-java@v4
1717
with:
18-
java-version: '23'
18+
java-version: '25'
1919
distribution: 'temurin'
2020

2121
- name: Set up JDK 17

.github/workflows/maven-central-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99
steps:
1010
- uses: actions/checkout@v4
1111

12-
- name: Set up JDK 23 for Javadoc toolchain
12+
- name: Set up JDK 25 for Javadoc toolchain
1313
uses: actions/setup-java@v4
1414
with:
15-
java-version: '23'
15+
java-version: '25'
1616
distribution: 'temurin'
1717

1818
- name: Set up JDK 17

.github/workflows/publish-snapshot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
- name: Checkout source code
1313
uses: actions/checkout@v4
1414

15-
- name: Set up JDK 23 for Javadoc toolchain
15+
- name: Set up JDK 25 for Javadoc toolchain
1616
uses: actions/setup-java@v4
1717
with:
18-
java-version: '23'
18+
java-version: '25'
1919
distribution: 'temurin'
2020

2121
- name: Set up JDK 17

pom.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
<maven-surefire-plugin.version>3.1.2</maven-surefire-plugin.version>
7777
<maven-failsafe-plugin.version>3.5.2</maven-failsafe-plugin.version>
7878
<maven-javadoc-plugin.version>3.11.2</maven-javadoc-plugin.version>
79-
<javadoc.jdk.version>23</javadoc.jdk.version>
79+
<javadoc.jdk.version>25</javadoc.jdk.version>
8080
<maven-source-plugin.version>3.3.0</maven-source-plugin.version>
8181
<jacoco-maven-plugin.version>0.8.10</jacoco-maven-plugin.version>
8282
<flatten-maven-plugin.version>1.5.0</flatten-maven-plugin.version>
@@ -286,6 +286,7 @@
286286
<doclint>none</doclint>
287287
<additionalOptions>
288288
<additionalOption>-Xdoclint:none</additionalOption>
289+
<additionalOption>--syntax-highlight</additionalOption>
289290
</additionalOptions>
290291
<source>${java.version}</source>
291292
<quiet>true</quiet>
@@ -313,7 +314,7 @@
313314
</plugins>
314315
</build>
315316
</profile>
316-
<!-- CI profile - requires JDK 23 toolchain for markdown support -->
317+
<!-- CI profile - requires JDK 25 toolchain for markdown support -->
317318
<profile>
318319
<id>javadoc-toolchain</id>
319320
<activation>

src/main/javadoc/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ Example: `mcp-core/src/main/javadoc/io/modelcontextprotocol/doc-files/getting-st
1616

1717
## Requirements
1818

19-
- **JDK 23+** is required to generate javadocs with markdown support (JEP 467)
19+
- **JDK 25+** is required to generate javadocs with markdown and syntax highlighting support
2020
- Files use CommonMark syntax with GitHub-flavored tables
21+
- Code blocks with language hints (e.g., ` ```java `) get automatic syntax highlighting
2122
- Generate docs locally: `mvn -Pjavadoc javadoc:aggregate`
2223

2324
## Linking to Documentation
@@ -43,7 +44,9 @@ See [Getting Started](io/modelcontextprotocol/doc-files/getting-started.html)
4344
The javadoc tool supports CommonMark with these extensions:
4445

4546
- GitHub-flavored tables
46-
- Fenced code blocks with syntax highlighting
47+
- Fenced code blocks with syntax highlighting (via `--syntax-highlight` option using highlight.js)
4748
- Links to Java elements: `[text][java.util.List]`
4849

50+
Supported languages for syntax highlighting include Java, JSON, XML, HTML, and Properties.
51+
4952
For full details, see [JEP 467: Markdown Documentation Comments](https://openjdk.org/jeps/467).

0 commit comments

Comments
 (0)