Skip to content

Commit 04605f9

Browse files
committed
Add new languages FAQ entry to README
1 parent e4241c6 commit 04605f9

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ the section "[Children Function](#children-function)".
140140
> `string` | _required_
141141

142142
This is the language that your code will be highlighted as. You can see a list
143-
of all languages that are supported out of the box [here](./src/vendor/prism/includeLangs.js).
143+
of all languages that are supported out of the box [here](./src/vendor/prism/includeLangs.js). Not all languages are included and the list of languages that are currently is a little arbitrary. You can use the [escape-hatch](https://github.com/FormidableLabs/prism-react-renderer#prism) to use your own Prism setup, just in case, or [add more languages to the bundled Prism.](https://github.com/FormidableLabs/prism-react-renderer#faq)
144144

145145
### code
146146

@@ -304,6 +304,23 @@ When converting a Prism CSS theme it's mostly just necessary to use classes as
304304

305305
<details>
306306

307+
<summary>How do I add more language highlighting support?</summary>
308+
309+
</details>
310+
311+
By default `prism-react-renderer` only includes an arbitrary subset of the languages that Prism supports. You can add support for more by including their defimitions from the main `prismjs` package:
312+
313+
```js
314+
import Prism from "prism-react-renderer/prism";
315+
316+
(typeof global !== "undefined" ? global : window).Prism = Prism;
317+
318+
require("prismjs/components/prism-kotlin");
319+
require("prismjs/components/prism-csharp");
320+
```
321+
322+
<details>
323+
307324
<summary>How do I use my old Prism css themes?</summary>
308325

309326
`prism-react-renderer` still returns you all proper `className`s via the prop getters,
@@ -361,7 +378,7 @@ MIT
361378

362379
## Maintenance Status
363380

364-
**Active:** Formidable is actively working on this project, and we expect to continue for work for the foreseeable future. Bug reports, feature requests and pull requests are welcome.
381+
**Active:** Formidable is actively working on this project, and we expect to continue for work for the foreseeable future. Bug reports, feature requests and pull requests are welcome.
365382

366383
[maintenance-image]: https://img.shields.io/badge/maintenance-active-green.svg
367384

0 commit comments

Comments
 (0)