See: Description
| Class | Description |
|---|---|
| SyntaxHighlighter |
Server-side syntax highlighting for code blocks in HTML documents.
|
| SyntaxHighlighter.HighlightResult |
Result of automatic language detection and highlighting.
|
| TextUtils |
Text utilities providing Markdown-to-HTML conversion via dynamically loaded
commonmark-java libraries.
|
| TextUtils.DocumentBuilder |
Builder for full HTML documents with configurable theme, title, language,
and CSS handling.
|
| Enum | Description |
|---|---|
| SyntaxHighlighter.HighlightTheme |
Available CSS themes for syntax-highlighted code blocks.
|
| SyntaxHighlighter.ThemeSet |
Identifies which set a theme belongs to.
|
| SyntaxHighlighter.ThemeType |
Classification of a highlight theme's visual appearance.
|
| TextUtils.Theme |
Available CSS themes for Markdown document rendering.
|
This package provides a complete pipeline for converting Markdown text into styled HTML documents with optional syntax-highlighted code blocks — all without requiring any client-side JavaScript. The two main entry points are:
TextUtils — Markdown-to-HTML conversion using
commonmark-java,
with a fluent DocumentBuilder
for full HTML5 document output including CSS theming.SyntaxHighlighter — Server-side syntax
highlighting using
Highlight.java
(a pure Java port of highlight.js),
supporting ~25 programming languages and 77 CSS color themes.Both engines have zero compile-time dependencies on their respective
libraries. At runtime, each engine locates its uber JAR, creates an isolated
URLClassLoader, and interacts with the library entirely via
reflection. This ensures complete classpath isolation and allows independent
version upgrades without affecting the server build.
| JAR | Contents | Java |
|---|---|---|
np-md-java8.jar | commonmark 0.21.0 + 8 extensions | 8+ |
np-md-java17.jar | commonmark 0.22+ + 9 extensions (incl. footnotes) | 11+ |
np-html-highlighter.jar | Highlight.java 1.0.3 | 8+ |
Theme CSS files are stored as classpath resources alongside the Java sources (not inside the uber JARs), so they can be loaded independently of the engines:
co/mindus/utils/md/css/ — 6 Markdown document themes
(3 light/dark pairs: Basic, Modern, GitHub)co/mindus/utils/hl/css/curated/ — 16 hand-picked syntax
highlight themesco/mindus/utils/hl/css/extended/ — 61 additional highlight
themes from highlight.jsTextUtils is initialized lazily and cached statically —
thread-safe for concurrent use. SyntaxHighlighter offers two models:
create() /
dispose() —
ideal for batch processing where each thread creates its own instance.getInstance() /
disposeShared()
— a process-wide instance with synchronized access, suitable for
lightweight or infrequent highlighting.The DocumentBuilder manages
the SyntaxHighlighter lifecycle internally — most callers never
interact with it directly.
GFM Tables, Strikethrough, Task Lists, Autolinks, Heading Anchors, Image Attributes, Insert (underline), YAML Front Matter, and Footnotes (Java 11+ only).
co.mindus.utils.md — Classpath resources for the Markdown
engine (document theme CSS files and commonmark uber JARs).co.mindus.utils.test — Visual test suite for comparing all
theme combinations across Java versions.
// Minimal: Markdown → full HTML document with default theme + syntax highlighting:
String doc = TextUtils.documentBuilder()
.markdown(markdownText)
.syntaxHighlight(true)
.build();
// Custom theme pairing:
String doc = TextUtils.documentBuilder()
.markdown(markdownText)
.theme(TextUtils.Theme.GITHUB_DARK)
.highlightTheme(SyntaxHighlighter.HighlightTheme.NORD)
.build();
(c) Copyright Mindus SARL, 2026. All rights reserved.
TextUtils,
SyntaxHighlighterPhantom® and NetPhantom® are registered trademarks of Mindus SARL.
© 2026 Mindus SARL. All rights reserved.