From 76050e36801eb97b725ba65038747e6bc10ecb8e Mon Sep 17 00:00:00 2001 From: Joe Pea Date: Sat, 27 Jun 2020 03:05:16 -0700 Subject: [PATCH] Update language-highlight.md (#1251) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update language-highlight.md * Update language-highlight.md Co-authored-by: 沈唁 <52o@qq52o.cn> --- docs/language-highlight.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/language-highlight.md b/docs/language-highlight.md index 0d66b55..25b5bb5 100644 --- a/docs/language-highlight.md +++ b/docs/language-highlight.md @@ -8,4 +8,25 @@ ``` +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.