You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-73Lines changed: 14 additions & 73 deletions
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,7 @@ _(If you just want to use your Prism CSS-file themes, that's also no problem)_
40
40
41
41
-[Installation](#installation)
42
42
-[Usage](#usage)
43
+
-[Custom Language Support](#custom-language-support)
43
44
-[Basic Props](#basic-props)
44
45
-[children](#children)
45
46
-[language](#language)
@@ -53,7 +54,6 @@ _(If you just want to use your Prism CSS-file themes, that's also no problem)_
53
54
-[`getLineProps`](#getlineprops)
54
55
-[`getTokenProps`](#gettokenprops)
55
56
-[Theming](#theming)
56
-
-[FAQ](#faq)
57
57
-[LICENSE](#license)
58
58
59
59
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
@@ -74,7 +74,7 @@ pnpm add prism-react-renderer
74
74
75
75
> Prism React Renderer has a peer dependency on `react`
76
76
77
-
### How to use Prism React Renderer
77
+
### Usage
78
78
Prism React Renderer has a named export for the `<Highlight />` component along with `themes`. To see Prism React Render in action with base styling check out `packages/demo` or run `pnpm run start:demo` from the root of this repository.
79
79
80
80
```tsx
@@ -121,6 +121,18 @@ ReactDOM.createRoot(document.getElementById("root") as HTMLElement)
121
121
122
122
```
123
123
124
+
### Custom Language Support
125
+
126
+
By default `prism-react-renderer` only includes a [base set of languages](https://github.com/FormidableLabs/prism-react-renderer/blob/c914fdea48625ba59c8022174bb3df1ed802ce4d/packages/generate-prism-languages/index.ts#L9-L23) that Prism supports. **Depending on your app's build system you may need to `await` the `import` or use `require` to ensure `window.Prism` exists before importing the custom languages.** You can add support for more by including their definitions from the main `prismjs` package:
@@ -306,77 +318,6 @@ property limits styles to highlighted languages.
306
318
When converting a Prism CSS theme it's mostly just necessary to use classes as
307
319
`types` and convert the declarations to object-style-syntax and put them on `style`.
308
320
309
-
## FAQ
310
-
311
-
<details>
312
-
313
-
<summary>How do I add more language highlighting support?</summary>
314
-
315
-
By default `prism-react-renderer` only includes an [arbitrary subset of the languages](https://github.com/FormidableLabs/prism-react-renderer/blob/master/src/vendor/prism/includeLangs.js) that Prism supports. You can add support for more by including their definitions from the main `prismjs` package:
0 commit comments