Skip to content

Commit 76050e3

Browse files
trusktrsy-records
andauthored
Update language-highlight.md (#1251)
* Update language-highlight.md * Update language-highlight.md Co-authored-by: 沈唁 <[email protected]>
1 parent 13f91a4 commit 76050e3

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

docs/language-highlight.md

+21
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,25 @@
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+
{
27+
return 123;
28+
}
29+
```
30+
````
31+
1132
?> Check the [component files](https://github.com/PrismJS/prism/tree/gh-pages/components) list for more options.

0 commit comments

Comments
 (0)