Package co.mindus.utils


package co.mindus.utils
Utility classes for server-side Markdown rendering and syntax highlighting.

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:

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

Libraries, built by BuildUtil\markdown into com.iizix.core\lib\markdown
JARContents
iizi-markdown.jarcommonmark 0.29.0 + 10 extensions + autolink-java 0.11.0
iizi-html-highlighter.jarHighlight.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 themes
  • co/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's lib/markdown directory, not here.
  • co.mindus.utils.test — Visual test suite for comparing all theme combinations. Not shipped: the sources are parked in BuildUtil\markdown\test and 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: