Update language-highlight.md (#1251)

* Update language-highlight.md

* Update language-highlight.md

Co-authored-by: 沈唁 <52o@qq52o.cn>
This commit is contained in:
Joe Pea 2020-06-27 03:05:16 -07:00 committed by GitHub
parent 13f91a4fcb
commit 76050e3680
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.