Skip to content

Commit 138b989

Browse files
authored
Update language-highlight.md
1 parent 13f91a4 commit 138b989

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

docs/language-highlight.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,24 @@
88
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-php.min.js"></script>
99
```
1010

11+
To use the new languages, make sure the code block label matches the part after `prism-` in the file name. FOr example, for `prism-bash.js` write a code block labeled with `bash` like this:
12+
13+
````
14+
```bash
15+
echo "hello"
16+
```
17+
````
18+
19+
?> Note that with GitHub-flavored markdown, `sh` and `bash` are effectively aliases of each other, but this is not the case with Prism. So using `sh` will not enable `bash` syntax in this case.
20+
21+
For `prism-php.js`, it would be:
22+
23+
````
24+
```php
25+
function getAdder(int $x): int {
26+
return 123
27+
}
28+
```
29+
````
30+
1131
?> Check the [component files](https://github.com/PrismJS/prism/tree/gh-pages/components) list for more options.

0 commit comments

Comments
 (0)