Skip to content
This repository has been archived by the owner on Oct 5, 2021. It is now read-only.
/ enlight Public archive

Syntax highlighting and source code detection for various languages.

License

Notifications You must be signed in to change notification settings

EvidentSolutions/enlight

Repository files navigation

Enlight

Enlight is a library that provides syntax highlighting and source code detection for various languages.

Build Status

Get started

The facade class fi.evident.enlight.Enlight is an entry-point to all functionality. It has just two interesting static methods:

  • Language recognizeLanguage(String source)

    Tries to recognize the language based on various heuristics. Returns null if the language could not be recognized.

  • HighlightedSource highlight(String source, Language language)

    Returns a highlighted representation of given source string. The highlighted representation is not dependent on any particular way of presenting it (such as HTML), but is in a form that it should be easy to create formatters from it. See classes in fi.evident.enlight.highlighter for more details.

Using Enlight with Maven

Enlight is available on the central Maven repository, so just add the following dependency to your pom.xml:

<dependency>
    <groupId>fi.evident.enlight</groupId>
    <artifactId>enlight</artifactId>
    <version>0.2.2</version>
</dependency>

About

Syntax highlighting and source code detection for various languages.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages