mirror of
https://gitee.com/docsifyjs/docsify.git
synced 2024-11-30 02:58:37 +08:00
Update language-highlight.md (#1251)
* Update language-highlight.md * Update language-highlight.md Co-authored-by: 沈唁 <52o@qq52o.cn>
This commit is contained in:
parent
13f91a4fcb
commit
76050e3680
@ -8,4 +8,25 @@
|
||||
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-php.min.js"></script>
|
||||
```
|
||||
|
||||
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:
|
||||
|
||||
````
|
||||
```bash
|
||||
echo "hello"
|
||||
```
|
||||
````
|
||||
|
||||
?> 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.
|
||||
|
||||
For `prism-php.js`, it would be:
|
||||
|
||||
````
|
||||
```php
|
||||
function getAdder(int $x): int
|
||||
{
|
||||
return 123;
|
||||
}
|
||||
```
|
||||
````
|
||||
|
||||
?> Check the [component files](https://github.com/PrismJS/prism/tree/gh-pages/components) list for more options.
|
||||
|
Loading…
Reference in New Issue
Block a user