Skip to content

Commit ad7c007

Browse files
authored
feat(docs): Add CodeBlock component (resend#1062)
1 parent 8489184 commit ad7c007

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

docs/changelog.mdx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ description: "New features, bug fixes, and improvements made to each package."
66
icon: "list-check"
77
---
88

9+
## Dec 01, 2023
10+
11+
**Code-block `0.0.1`**
12+
13+
- Add code-block component
14+
- Use modified version of [prismjs](https://prismjs.com/)
15+
- Default themes from [prismjs
16+
themes](https://github.com/PrismJS/prism-themes) exported [here](https://github.com/resendlabs/react-email/blob/canary/packages/code-block/src/themes.ts)
17+
918
## Nov 01, 2023
1019

1120
**Components `0.0.11`**

docs/components/code-block.mdx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
--
1+
---
22
title: 'Code block'
33
sidebarTitle: 'Code block'
44
description: 'Displays code with a selected theme and regex highlighting using prismjs.'
5-
--
5+
icon: 'code'
6+
---
67

78
## Install
89

@@ -107,8 +108,11 @@ An example of a theme would be this:
107108
}
108109
```
109110

110-
Each token type can have their own defined styles and for each one of there can be any styles that can be applied directly to `React` elements. As you can see from the example dracula theme though, there is a defined property called `base` which is the styling for the `pre` element that wraps the HTML being rendered.
111+
Each token type can have their own defined styles and for each one of there can be any styles that can be applied directly to `React` elements.
112+
As you can see from the example `dracula` theme though, there is a defined property called `base` which is the styling for the `pre` element that wraps the HTML being rendered.
111113

112-
For you to not need to defined a theme without any basis, or to not define one that already has been defined, we have a default `themes` object exported from `@react-email/code-block`. These themes were generated by a bit of code that converts a CSS file for a prismjs theme into a object theme of these. If you want to generate a theme from another existing prismjs theme you can do so by looking into [this](https://github.com/gabrielmfern/from-prismjs-to-react-email-code-block-theme).
114+
For you to not need to defined a theme without any basis, or to not define one that already has been defined, we have many default themes exported from `@react-email/code-block`.
115+
These themes were generated by a bit of code that converts a CSS file for a prismjs theme into a object theme of these.
116+
If you want to generate a theme from another existing prismjs theme you can do so by looking into [this](https://github.com/gabrielmfern/from-prismjs-to-react-email-code-block-theme).
113117

114118
<Snippet file="support.mdx" />

docs/mint.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
"components/image",
6969
"components/link",
7070
"components/markdown",
71+
"components/code-block",
7172
"components/preview",
7273
"components/section",
7374
"components/tailwind",

0 commit comments

Comments
 (0)