Package co.mindus.utils
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 fluentDocumentBuilderfor 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.
Library Dependencies
Both engines reference their libraries directly. The two jars are on the application class path, on com.iizix.core's Bundle-ClassPath for the Designer, and on the deployed server's class path, so commonmark and Highlight.java are ordinary compile-time types.
Until 2026-08-12 each engine located its jar at run time, loaded it into an isolated class loader and drove it entirely by reflection. That layer was removed once the jars were on the class path everywhere.
Library JARs
| JAR | Contents |
|---|---|
iizi-markdown.jar | commonmark 0.29.0 + 10 extensions + autolink-java 0.11.0 |
iizi-html-highlighter.jar | Highlight.java (codehighlight 1.0.3) |
CSS Resources
Theme CSS files are classpath resources alongside the Java sources, independent of the library jars, so they can be loaded without creating an engine:
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.js
Lifecycle
TextUtils is initialized lazily and cached statically — thread-safe for concurrent use. SyntaxHighlighter instances are created per use via create() and released with dispose(); an instance is not thread-safe, so each thread should create its own.
The DocumentBuilder manages the SyntaxHighlighter lifecycle internally — most callers never interact with it directly.
Supported Markdown Extensions
GFM Tables, Strikethrough, Task Lists, Autolinks, Heading Anchors, Image Attributes, Insert (underline), YAML Front Matter, and Footnotes.
Subpackages
co.mindus.utils.md— Classpath resources for the Markdown engine (the six document theme CSS files). The library jars live in the server'slib/markdowndirectory, not here.co.mindus.utils.test— Visual test suite for comparing all theme combinations. Not shipped: the sources are parked inBuildUtil\markdown\testand are on no build path.
Quick Start
// 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.
- Author:
- Christopher Mindus
- See Also:
- ClassDescriptionServer-side syntax highlighting for code blocks in HTML documents.Result of automatic language detection and highlighting.Available CSS themes for syntax-highlighted code blocks.Identifies which set a theme belongs to.Classification of a highlight theme's visual appearance.Text utilities providing Markdown-to-HTML conversion using the commonmark-java library.Builder for full HTML documents with configurable theme, title, language, and CSS handling.Available CSS themes for Markdown document rendering.