Last active
January 30, 2026 18:57
-
-
Save andreaTP/6945e9ff3223686b600fda184ae94e2f to your computer and use it in GitHub Desktop.
lumis4j.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ///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