Skip to content

Commit f711fd4

Browse files
committed
Move syntax highlighting update documentation to separate folder
Fixes #50
1 parent 68706e9 commit f711fd4

File tree

2 files changed

+31
-32
lines changed

2 files changed

+31
-32
lines changed

README.md

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -17,38 +17,6 @@ To deploy gb-asm-tutorial locally:
1717
This folder is what gets served when running `mdbook serve`, so you may see some custom markup missing if using that.
1818
As a workaround, you can manually open the files in the `book/custom/` folder in your browser, they just won't auto-refresh on changes.
1919

20-
### Syntax highlighting
21-
22-
Syntax highlighting is provided within the browser, courtesy of [`highlight.js`](https://github.com/highlightjs/highlight.js).
23-
[RGBASM syntax](https://rgbds.gbdev.io/docs/rgbasm.5) is highlighted via [a plugin](https://github.com/gbdev/highlightjs-rgbasm), but this requires a custom build of `highlight.js`.
24-
25-
Steps:
26-
27-
1. [Clone](https://docs.github.com/en/github/getting-started-with-github/getting-started-with-git/about-remote-repositories) `highlight.js` anywhere, and go into that directory.
28-
29-
You will probably want to target a specific version by checking out its tag.
30-
2. Run `npm install` to install its dependencies.
31-
3. Within the `extras/` directory, clone `highlightjs-rgbasm`; ensure the directory is called `rgbasm`, otherwise the build tool won't pick it up.
32-
4. You can work on and make modifications to `highlightjs-rgbasm`!
33-
5. To make the custom build of `highlight.js`, within the `highlight.js` directory, run `node tools/build.js -t browser <languages>...`, with `<languages>...` being the list of languages to enable support for.
34-
The languages identifiers are the same that you would use for highlighting (` ```rgbasm `, for example).
35-
6. Copy `build/highlight.min.js` as `theme/highlight.js` in Pan Docs' source.
36-
Alternatively, for debugging, you can use `build/highlight.js` for a non-minified version, but please don't commit that.
37-
38-
⚠️ `mdbook watch` and `mdbook serve` do *not* watch for changes to files in the `theme/` directory, you must trigger the build by either restarting the command, or manually changing one of the watched files.
39-
40-
Example:
41-
42-
```console
43-
$ git clone [email protected]:highlightjs/highlight.js.git
44-
$ cd highlight.js
45-
$ git checkout 10.7.2
46-
$ npm install
47-
$ git clone [email protected]:gbdev/highlightjs-rgbasm.git extras/rgbasm
48-
$ node tools/build.js -t browser rgbasm shell makefile
49-
$ cp build/highlight.min.js ../gb-asm-tutorial/theme/highlight.js
50-
```
51-
5220
## License
5321

5422
Different parts of gb-asm-tutorial are subject to different licenses:

theme/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Syntax highlighting
2+
3+
Syntax highlighting is provided within the browser, courtesy of [`highlight.js`](https://github.com/highlightjs/highlight.js).
4+
[RGBASM syntax](https://rgbds.gbdev.io/docs/rgbasm.5) is highlighted via [a plugin](https://github.com/gbdev/highlightjs-rgbasm), but this requires a custom build of `highlight.js`.
5+
6+
Here are the steps to generate a new `highlight.js`:
7+
8+
1. [Clone](https://docs.github.com/en/github/getting-started-with-github/getting-started-with-git/about-remote-repositories) `highlight.js` anywhere, and go into that directory.
9+
10+
You will probably want to target a specific version by checking out its tag.
11+
2. Run `npm install` to install its dependencies.
12+
3. Within the `extras/` directory, clone `highlightjs-rgbasm`; ensure the directory is called `rgbasm`, otherwise the build tool won't pick it up.
13+
4. You can work on and make modifications to `highlightjs-rgbasm`!
14+
5. To make the custom build of `highlight.js`, within the `highlight.js` directory, run `node tools/build.js -t browser <languages>...`, with `<languages>...` being the list of languages to enable support for.
15+
The languages identifiers are the same that you would use for highlighting (` ```rgbasm `, for example).
16+
6. Copy `build/highlight.min.js` as `theme/highlight.js` in Pan Docs' source.
17+
Alternatively, for debugging, you can use `build/highlight.js` for a non-minified version, but please don't commit that.
18+
19+
⚠️ `mdbook watch` and `mdbook serve` do *not* watch for changes to files in the `theme/` directory, you must trigger the build by either restarting the command, or manually changing one of the watched files.
20+
21+
Example:
22+
23+
```console
24+
$ git clone [email protected]:highlightjs/highlight.js.git
25+
$ cd highlight.js
26+
$ git checkout 10.7.2
27+
$ npm install
28+
$ git clone [email protected]:gbdev/highlightjs-rgbasm.git extras/rgbasm
29+
$ node tools/build.js -t browser rgbasm shell makefile
30+
$ cp build/highlight.min.js ../gb-asm-tutorial/theme/highlight.js
31+
```

0 commit comments

Comments
 (0)