https://github.com/markknol/html-haxe-code-highlighter
Basic Haxe code highlighting for HTML
https://github.com/markknol/html-haxe-code-highlighter
css haxe highlighter highlighting hxml
Last synced: about 1 month ago
JSON representation
Basic Haxe code highlighting for HTML
- Host: GitHub
- URL: https://github.com/markknol/html-haxe-code-highlighter
- Owner: markknol
- Created: 2018-04-09T10:08:00.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-01T09:09:57.000Z (almost 7 years ago)
- Last Synced: 2025-01-25T05:11:30.659Z (3 months ago)
- Topics: css, haxe, highlighter, highlighting, hxml
- Language: Haxe
- Size: 11.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple Haxe Code Highlighter for HTML
[](https://travis-ci.org/markknol/html-haxe-code-highlighter)
[](http://lib.haxe.org/p/p/html-haxe-code-highlighter)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 `` to your HTML.
2. Download and add `` to your HTML.## Installation using sources
If you want to integrate the highlighting in your project, install using [Haxelib](https://lib.haxe.org/p/html-haxe-code-highlighter/):
```
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 `` and `
` 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 classesThe following css classes are applied
| Description | CSS class |
|---|---|
| Reserved keywords | .kwd |
| Reserved values | .val |
| Types | .type |
| Strings | .str |
| Regexp | .ereg |
| Comments | .cmt |---
Build with [Haxe](https://haxe.org/)