html-haxe-code-highlighter

Basic runtime Haxe code highlighting for HTML
https://github.com/markknol/html-haxe-code-highlighter/

To install, run:

haxelib install html-haxe-code-highlighter 0.1.2 

See using Haxelib in Haxelib documentation for more information.

README.md

Simple Haxe Code Highlighter for HTML

Build Status Haxelib Version

Basic runtime Haxe code highlighting. Formerly used on haxe.org website.

Basic Installation

If you just want the highlighting, you can download and use the .js and .css files:

  1. Download and add <script src="highlighter.js"></script> to your HTML.
  2. Download and add <link rel="stylesheet" href="highlighter.min.css" /> to your HTML.

Installation using sources

If you want to integrate the highlighting in your project, install using Haxelib:

haxelib install html-haxe-code-highlighter

To use in code, add to your build hxml:

-lib html-haxe-code-highlighter

API

  • Highlighter.highlight(?container:js.html.Element) (JS target only) Adds highlighting to all <code class="prettyprint haxe"> and <code class="prettyprint hxml"> tags in the given element. If container is null, then document body element is used.

  • Highlighter.syntaxHighlightHaxe(code:String) Syntax highlight Haxe code. Returns code as formatted HTML text.

  • Highlighter.syntaxHighlightHXML(code:String) Syntax highlight HXML. Returns code as formatted HTML text.

CSS classes

The following css classes are applied

DescriptionCSS class
Reserved keywords.kwd
Reserved values.val
Types.type
Strings.str
Regexp.ereg
Comments.cmt

Build with Haxe

Contributors
markknol
Version
0.1.2
Published
2 months ago
License
MIT

All libraries are free

Every month, more than thousand developers use haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on Github!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on Github