# cirru-color

> cirru highlighting as HTML

Latest version **0.2.4** (published 2023-12-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install cirru-color
pnpm add cirru-color
yarn add cirru-color
bun add cirru-color
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.4 |
| Published | 2023-12-06 |
| First published | 2014-02-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 19.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | jiyinyiyong |
| Maintainers | jiyinyiyong |
| Keywords | cirru |

## Links

- npm: https://www.npmjs.com/package/cirru-color
- Repository: https://github.com/Cirru/cirru-color
- Homepage: http://repo.tiye.me/cirru-color
- Issues: https://github.com/Cirru/cirru-color/issues
- npm.io page: https://npm.io/package/cirru-color

## Recent versions

- 0.2.4 (latest) — 2023-12-06
- 0.2.3 — 2022-04-01
- 0.2.2 — 2022-04-01
- 0.2.1-a1 — 2021-08-28
- 0.2.0 — 2015-06-14
- 0.1.2 — 2014-08-30
- 0.1.1 — 2014-07-03
- 0.1.0 — 2014-02-19

## README

Cirru Color
------

Syntax highlighting tool inspired by Pygements

Demo http://repo.cirru.org/cirru-color/

It's mainly based on my [PR on pygments][pr] for adding Cirru highlighting.

[pr]: https://github.com/pygments/pygments/blob/master/pygments/lexers/webmisc.py#L866

### Usage

```bash
npm install cirru-color
```

Highlight code:

```coffee
import {generateHtml} from 'cirru-color'
html = generateHtml 'cirru code'
```

Styles in `/assets/cirru.css`.

Or just parsing:

```coffee
import {parse} from 'cirru-color'
tokens = parse 'cirru code'
```

valid types here are:

```
whitespace
func
para
punc
dollar
string
string-text
escape
escape-text
```

for code:

```cirru
print $ unwrap $
```

it returns:

```json
[
  [
    {
      "type": "func",
      "text": "print"
    },
    {
      "type": "whitespace",
      "text": " "
    },
    {
      "type": "dollar",
      "text": "$"
    },
    {
      "type": "whitespace",
      "text": " "
    },
    {
      "type": "func",
      "text": "unwrap"
    },
    {
      "type": "whitespace",
      "text": " "
    },
    {
      "type": "dollar",
      "text": "$"
    }
  ]
]
```

### License

MIT

---
_Source: https://npm.io/package/cirru-color · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
