diff --git a/docs/index.html b/docs/index.html index 41979e96f..3f518db13 100644 --- a/docs/index.html +++ b/docs/index.html @@ -92,20 +92,21 @@ } ] } - - - - - - - - - - + + + + + + + + + + + diff --git a/docs/language-highlight.md b/docs/language-highlight.md index 0d66b55b7..1e089c10d 100644 --- a/docs/language-highlight.md +++ b/docs/language-highlight.md @@ -1,11 +1,53 @@ -# language highlight +# Language highlighting -**docsify** uses [Prism](https://github.com/PrismJS/prism) to highlight code blocks in your pages. By default it only supports CSS, JavaScript and HTML. You can make **Prism** load additional languages: +Docsify uses [Prism](https://prismjs.com) to highlight code blocks in your pages. Prism supports the following languages by default: + +* Markup - `markup`, `html`, `xml`, `svg`, `mathml`, `ssml`, `atom`, `rss` +* CSS - `css` +* C-like - `clike` +* JavaScript - `javascript`, `js` + +Support for [additional languages](https://prismjs.com/#supported-languages) is available by loading the language-specific [grammar files](https://cdn.jsdelivr.net/npm/prismjs@1/components/) via CDN: ```html - - - + + ``` -?> Check the [component files](https://github.com/PrismJS/prism/tree/gh-pages/components) list for more options. +To enable syntax highlighting, wrap each code block in triple backticks with the [language](https://prismjs.com/#supported-languages) specified on the first line: + +```` +```html +

This is a paragraph

+Docsify +``` + +```bash +echo "hello" +``` + +```php +function getAdder(int $x): int +{ + return 123; +} +``` +```` + +The above markdown will be rendered as: + +```html +

This is a paragraph

+Docsify +``` + +```bash +echo "hello" +``` + +```php +function getAdder(int $x): int +{ + return 123; +} +```