Skip to content

Commit

Permalink
docs: add a note about additional languages needing to be Prism compo…
Browse files Browse the repository at this point in the history
…nent names (#7110)
  • Loading branch information
Josh-Cena authored Apr 4, 2022
1 parent 85f47fd commit 4194925
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ Some popular languages like Java, C#, or PHP are not enabled by default.

To add syntax highlighting for any of the other [Prism-supported languages](https://prismjs.com/#supported-languages), define it in an array of additional languages.

:::note

Each additional language has to be a valid Prism component name. For example, Prism would map the _language_ `cs` to `csharp`, but only `prism-csharp.js` exists as a _component_, so you need to use `additionalLanguages: ['csharp']`. You can look into `node_modules/prismjs/components` to find all components (languages) available.

:::

For example, if you want to add highlighting for the PowerShell language:

```js title="docusaurus.config.js"
Expand Down

0 comments on commit 4194925

Please sign in to comment.