Skip to content

Commit 6c989c1

Browse files
committed
feat: add basic grammer definition file
1 parent efc56d6 commit 6c989c1

File tree

6 files changed

+443
-0
lines changed

6 files changed

+443
-0
lines changed

README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# highlighths-spl - a grammar file for Splunk search processing language
2+
3+
## Usage
4+
5+
Simply include the `highlight.js` library in your webpage or Node app, then load this module.
6+
7+
### Static website or simple usage
8+
9+
Simply load the module after loading `highlight.js`. You'll use the minified version found in the `dist` directory. This module is just a CDN build of the language, so it will register itself as the Javascript is loaded.
10+
11+
```html
12+
<script type="text/javascript" src="/path/to/highlight.min.js"></script>
13+
<script type="text/javascript" src="/path/to/spl.min.js"></script>
14+
<script type="text/javascript">
15+
hljs.highlightAll();
16+
</script>
17+
```
18+
19+
### [WIP] Using directly from the UNPKG CDN
20+
21+
```html
22+
<!-- <script type="text/javascript"
23+
src="https://unpkg.com/highlightjs-spl@0.1.0/dist/spl.min.js"></script> -->
24+
```
25+
26+
- More info: <https://unpkg.com>
27+
28+
### With Node or another build system
29+
30+
If you're using Node / Webpack / Rollup / Browserify, etc, simply require the language module, then register it with Highlight.js.
31+
32+
```javascript
33+
var hljs = require('highlight.js');
34+
var hljsRobotsTxt = require('highlightjs-spl');
35+
36+
hljs.registerLanguage("spl", hljsRobotsTxt);
37+
hljs.initHighlightingOnLoad();
38+
```
39+
40+
41+
## License
42+
43+
`highlight.js` is released under the MIT License. See [LICENSE][1] file for details.
44+
45+
### Author
46+
47+
Wei Su <swsoyee@gmail.com>
48+
49+
## Links
50+
51+
- The official site for the `highlight.js` library is <https://highlightjs.org/>.
52+
- The `highlight.js` GitHub project: <https://github.com/highlightjs/highlight.js>
53+
- Learn more about Splunk search processing language: <https://docs.splunk.com/Splexicon:SPL>
54+
55+
[1]: https://github.com/highlightjs/highlightjs-robots-txt/blob/master/LICENSE

dist/spl.min.js

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)