Include lang="xxxx" in Prism component example (#1264)
This commit is contained in:
parent
9823f16f51
commit
3d73d7fbf2
1 changed files with 4 additions and 2 deletions
|
@ -26,10 +26,12 @@ See our [Markdown Guide](/guides/markdown-content) for more info.
|
|||
---
|
||||
import { Prism } from 'astro/components';
|
||||
---
|
||||
<Prism code={`const foo = 'bar';`} />
|
||||
<Prism lang="js" code={`const foo = 'bar';`} />
|
||||
```
|
||||
|
||||
This component provides syntax highlighting for code blocks. Since this never changes in the client it makes sense to use an Astro component (it's equally reasonable to use a framework component for this kind of thing; Astro is server-only by default for all frameworks!).
|
||||
This component provides language-specific syntax highlighting for code blocks. Since this never changes in the client it makes sense to use an Astro component (it's equally reasonable to use a framework component for this kind of thing; Astro is server-only by default for all frameworks!).
|
||||
|
||||
See the [list of languages supported by Prism](https://prismjs.com/#supported-languages) where you can find a language's corresponding alias. And, you can also display your Astro code blocks with lang="astro"!
|
||||
|
||||
## `<Debug />`
|
||||
|
||||
|
|
Loading…
Reference in a new issue