Skip to content

Commit 5725aa9

Browse files
committed
Upload to NPM
1 parent 5133538 commit 5725aa9

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,41 @@
55
This repository provides syntax highlighting for Highlight.js for Structured Text. ST is one of the 6 languages of IEC 61131-3 standard developed in 1998 for developing PLC programs.
66

77
We want to provide ST syntax highlights in VS Code Markdown editor and Markdown preview. And other cases when tutorials are published in the web.
8+
9+
## Usage
10+
11+
Include the `highlight.js` script package in your webpage or node app, load this module and register it with `hljs`. Follow instructions at [highlightjs](https://highlightjs.org/) to learn how to include the library and CSS.
12+
13+
If you're not using a build system and just want to embed this in your webpage:
14+
15+
```html
16+
<script type="text/javascript" src="/path/to/highlight.pack.js"></script>
17+
<script type="text/javascript" src="/path/to/highlightjs-structured-text/iecst.js"></script>
18+
<script type="text/javascript">
19+
hljs.registerLanguage('iecst', window.hljsDefineIECST);
20+
hljs.initHighlightingOnLoad();
21+
</script>
22+
```
23+
24+
If you're using webpack / rollup / browserify / node:
25+
26+
```javascript
27+
var hljs = require('highlightjs');
28+
var hljsDefineCUrl = require('highlightjs-structured-text');
29+
30+
hljsDefineIECST(hljs);
31+
hljs.initHighlightingOnLoad();
32+
```
33+
34+
Mark the code you want to highlight with the curl class:
35+
36+
```html
37+
<pre><code class="iecst">...</code></pre>
38+
```
39+
40+
or use JavaScript to dynamically highlight text:
41+
42+
```javascript
43+
hljs.registerLanguage('iecst', window.hljsDefineIECST);
44+
var highlighted = hljs.highlightAuto(text, ["iecst"]);
45+
```

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "highlightjs-structured-text",
3-
"version": "1.0.1",
3+
"version": "1.0.0",
44
"description": "highlight.js syntax definition for Structured Text IEC 61131-3 language",
55
"main": "iecst.js",
66
"scripts": {

0 commit comments

Comments
 (0)