Skip to content

Commit

Permalink
README
Browse files Browse the repository at this point in the history
  • Loading branch information
brendt committed Mar 15, 2024
1 parent 6dfd2c6 commit a0399bf
Showing 1 changed file with 52 additions and 1 deletion.
53 changes: 52 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,52 @@
## Fast, extensible, server-side code highlighting
# Fast, extensible, server-side code highlighting

## Quickstart

Highlight code like this

```php
$highlighter = new \Tempest\Highlight\Highlighter();

$code = $highlighter->parse($escapedCode, 'php');
```

**Note: you always pass in the _escaped_ version of your code**:

```php
$code = $highlighter->parse(htmlentities($raw), 'php');
```

Next, you can import one of the provided themes:

```css
@import "../vendor/tempest/highlight/src/Themes/highlight-tempest.css";
@import "../vendor/tempest/highlight/src/Themes/highlight-light-lite.css";
```

Or you can build your own with just a couple of classes:

```css
.hl-keyword {
color: #4F95D1;
}

.hl-property {
color: #46b98d;
}

.hl-attribute {
font-style: italic;
}

.hl-type {
color: #D14F57;
}

.hl-generic {
color: #9D3AF6;
}

.hl-comment {
color: #888888;
}
```

0 comments on commit a0399bf

Please sign in to comment.