-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Update language-highlight.md #1251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is confusing for a few reasons:
I suggest we just delete the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Maybe I should say "Markdown on GitHub". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When I add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was incorrect about The difference between GitHub and Prism highlighting is:
Summary: Docsify uses Prism aliases only, GitHub uses language aliases and extensions. |
||
|
||
For `prism-php.js`, it would be: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need two examples? If we want two, why not use one of the built-in languages ( |
||
|
||
```` | ||
```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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor typo: "FOr" should be "For" (lower-case "O").