Skip navigation links

Package co.mindus.utils

Utility classes for server-side Markdown rendering and syntax highlighting.

See: Description

Package co.mindus.utils Description

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:

Zero Compile-Time Dependencies

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.

Uber JARs

Runtime JARs (located via classpath resource or C:\NP6\Java\Base\)
JARContentsJava
np-md-java8.jarcommonmark 0.21.0 + 8 extensions8+
np-md-java17.jarcommonmark 0.22+ + 9 extensions (incl. footnotes)11+
np-html-highlighter.jarHighlight.java 1.0.38+

CSS Resources

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:

Lifecycle Models

TextUtils is initialized lazily and cached statically — thread-safe for concurrent use. SyntaxHighlighter offers two models:

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 (Java 11+ only).

Subpackages

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:
TextUtils, SyntaxHighlighter
Skip navigation links

Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© 2026 Mindus SARL. All rights reserved.