Skip to content

Instantly share code, notes, and snippets.

@andreaTP
Last active January 30, 2026 18:57
Show Gist options
  • Select an option

  • Save andreaTP/6945e9ff3223686b600fda184ae94e2f to your computer and use it in GitHub Desktop.

Select an option

Save andreaTP/6945e9ff3223686b600fda184ae94e2f to your computer and use it in GitHub Desktop.
lumis4j.java
///usr/bin/env jbang "$0" "$@" ; exit $?
// Demo for: https://github.com/roastedroot/lumis4j
//DEPS io.roastedroot:lumis4j:0.0.1
import static java.lang.System.*;
import io.roastedroot.lumis4j.core.Lumis;
import io.roastedroot.lumis4j.core.Lang;
import io.roastedroot.lumis4j.core.Theme;
import io.roastedroot.lumis4j.core.Formatter;
public class lumis4j {
public static void main(String... args) {
for (var theme: Theme.values()) {
try (var htmlLumis = Lumis.builder()
.withLang(Lang.JAVA)
.withTheme(theme)
.withFormatter(Formatter.TERMINAL)
.build()) {
var htmlResult = htmlLumis.highlight("public class Hello { }");
out.println(htmlResult.string());
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment