Skip to content

Commit 733cb8c

Browse files
committed
improve documentation and release process
1 parent e98b116 commit 733cb8c

File tree

4 files changed

+55
-3
lines changed

4 files changed

+55
-3
lines changed

Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,13 @@ clean:
1717
run: gen
1818
echo "Starting at http://localhost:8000"
1919
python -m SimpleHTTPServer # Python2.7
20-
# python -m http.server 8000 # Python 3
20+
# python -m http.server 8000 # Python 3
21+
22+
tag-patch:
23+
bash scripts/update.sh --patch
24+
25+
tag-minor:
26+
bash scripts/update.sh --minor
27+
28+
tag-major:
29+
bash scripts/update.sh --major

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,36 @@
44

55
[![GitHub License](https://img.shields.io/github/license/joshraphael/highlightjs-rascript)](https://github.com/joshraphael/highlightjs-rascript/blob/main/LICENSE)
66
[![test](https://github.com/joshraphael/highlightjs-rascript/actions/workflows/test.yaml/badge.svg)](https://github.com/joshraphael/highlightjs-rascript/actions/workflows/test.yaml)
7+
[![release](https://github.com/joshraphael/highlightjs-rascript/actions/workflows/release.yaml/badge.svg)](https://github.com/joshraphael/highlightjs-rascript/actions/workflows/release.yaml)
78
[![GitHub Tag](https://img.shields.io/github/v/tag/joshraphael/highlightjs-rascript)](https://github.com/joshraphael/highlightjs-rascript/tags)
89
[![GitHub repo size](https://img.shields.io/github/repo-size/joshraphael/highlightjs-rascript)](https://github.com/joshraphael/highlightjs-rascript/archive/main.zip)
910

11+
Available on [NPM](https://www.npmjs.com/package/@joshraphael/highlightjs-rascript) and [Github Packages](https://github.com/joshraphael/highlightjs-rascript/pkgs/npm/highlightjs-rascript)
12+
13+
## Setup
14+
15+
Directly import the distribution library and have RAScript autodetected
16+
17+
### Static Website
18+
19+
```html
20+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/highlight.min.js"></script>
21+
<script src="https://raw.githubusercontent.com/joshraphael/highlightjs-rascript/refs/heads/main/dist/rascript.min.js"></script>
22+
<script type="text/javascript">
23+
hljs.highlightAll();
24+
</script>
25+
```
26+
27+
### Node
28+
29+
```js
30+
var hljs = require('highlight.js');
31+
var rascript = require('@joshraphael/highlightjs-rascript');
32+
33+
hljs.registerLanguage("rascript", rascript);
34+
hljs.highlightAll();
35+
```
36+
1037
## Commands:
1138

1239
|Title|Command|Parameters|Description|

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/obsidian.min.css">
2-
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
1+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/styles/obsidian.min.css">
2+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/highlight.min.js"></script>
33
<script src="dist/rascript.min.js"></script>
44
<script type="module">
55
hljs.highlightAll();

scripts/update.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
if [[ $(git diff --stat) != '' ]]; then
4+
echo 'Branch has uncommitted changes'
5+
exit 1
6+
else
7+
if [[ $1 == '--patch' ]]; then
8+
npm version patch
9+
fi
10+
if [[ $1 == '--minor' ]]; then
11+
npm version minor
12+
fi
13+
if [[ $1 == '--major' ]]; then
14+
npm version major
15+
fi
16+
fi

0 commit comments

Comments
 (0)