An open API service indexing awesome lists of open source software.

https://github.com/timonson/himple

Lightweight tokenizer and syntax highlighter
https://github.com/timonson/himple

syntax-highlighter tokenizer web-components

Last synced: about 1 month ago
JSON representation

Lightweight tokenizer and syntax highlighter

Awesome Lists containing this project

README

          

# himple

Lightweight tokenizer and syntax highlighter

#### The following code will generate a rendered code block...

```html



import createHimple from "./himple.js"
const himple = createHimple()
const codeString = `h(
"ul",
{ class: "demo-switcher" },
listElementContent.map((el, i) =>
h(
"li",
{
onclick: event => change.next(event),
class: i === 0 ? "active-index" : null,
},
el.toString()
)
)
)
`
hFuncString.innerHTML = codeString
himple(hFuncString)

```

#### ... which looks like this

![](./himple-example.png "himple highlighting")

## Credit

Lars Jung and his [lolight project](https://github.com/lrsjng/lolight)