https://github.com/coldspirit0/synhi
Simple syntax highlighter
https://github.com/coldspirit0/synhi
easy-to-use javascript simple syntax syntax-highlighter syntax-highlighting
Last synced: about 1 month ago
JSON representation
Simple syntax highlighter
- Host: GitHub
- URL: https://github.com/coldspirit0/synhi
- Owner: ColdSpirit0
- License: mit
- Created: 2020-07-03T05:38:04.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-03T22:51:44.000Z (about 6 years ago)
- Last Synced: 2025-02-22T21:22:19.030Z (over 1 year ago)
- Topics: easy-to-use, javascript, simple, syntax, syntax-highlighter, syntax-highlighting
- Language: JavaScript
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Synhi - simple syntax highlighter
Synhi is a tool in one function to create own syntax themes.
## How to use:
### 1. Insert code in your project
That's all code you need: [synhi.js](synhi.js).
### 2. Add CSS classes you need
Example:
```css
.hl_keyword {color: blue;}
```
### 3. Highlight your text
Call the function and pass element with text, regex rule to find it and class that will highlight the text.
```javascript
highlight(target_element, /(keyword)/, "hl_keyword");
```
### 4. Enjoy
That result you will get:

### Demo with ini syntax
This example does not cover the entire ini syntax; it is made to show the capabilities of the tool.
https://jsfiddle.net/ColdSpirit/6v74p8x5/
Demo backup: [demo_ini.html](demo_ini.html)