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
+10-13Lines changed: 10 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Read the documentation [here](https://md2re.codeskills.dev/)
4
4
5
5
## Description
6
6
7
-
md-to-react-email is a lightweight utility for converting [Markdown](https://www.markdownguide.org/) into valid [React-email](https://react.email) templates. This tool simplifies the process of creating responsive and customizable email templates by leveraging the power of React and Markdown.
7
+
md-to-react-email is a lightweight utility for converting [Markdown](https://www.markdownguide.org/) into valid JSX that can be used in [React-email](https://react.email) or [JSX-email](https://jsx.email) templates. This tool simplifies the process of creating responsive and customizable email templates by leveraging the power of React and Markdown.
8
8
9
9
**Note**: Starting from `version 4`, `md-to-react-email` uses [`Marked`](https://marked.js.org/) for markdown transformation. see all changes [here](/CHANGELOG.md)
10
10
@@ -36,25 +36,25 @@ npm install md-to-react-email
36
36
37
37
-`camelToKebabCase`: converts strings from camelcase ['thisIsCamelCase'] to kebab case ['this-is-kebab-case']
38
38
-`parseCssInJsToInlineCss`: converts css styles from css-in-js to inline css e.g fontSize: "18px" => font-size: 18px;
39
-
-`parseMarkdownToReactEmailJSX`: parses markdown to valid react-email JSX for the client (i.e the browser)
39
+
-`parseMarkdownToJSX`: parses markdown to valid JSX for the client (i.e the browser)
40
40
41
41
### Components:
42
42
43
-
-`ReactEmailMarkdown`: a react-email component that takes in markdown input and parses it directly in your code base
43
+
-`EmailMarkdown`: a react component that takes in markdown input and parses it directly in your code base
44
44
45
45
## Usage:
46
46
47
-
- Directly as [`React-email`](https://react.email) component
47
+
- Directly as [`React-email`](https://react.email)or [`JSX-email`](https://jsx.email)component
48
48
49
49
```
50
-
import {ReactEmailMarkdown} from "md-to-react-email"
md-to-react-email contains pre-defined react-email and html components for the email template structure and styling. You can modify these components to customize the look and feel of your email template.
77
+
md-to-react-email contains pre-defined react and html components for the email template structure and styling. You can modify these components to customize the look and feel of your email template.
81
78
82
79
The following components are available for customization:
83
80
@@ -95,7 +92,7 @@ The following components are available for customization:
95
92
96
93
## Supported Email Clients
97
94
98
-
The provided React-email components and default styling are designed to work well across various email clients and providers. However, due to the inconsistent support for modern web standards in different email clients, it's recommended to test your email templates in multiple clients to ensure compatibility.
95
+
The provided React components and default styling are designed to work well across various email clients and providers. However, due to the inconsistent support for modern web standards in different email clients, it's recommended to test your email templates in multiple clients to ensure compatibility.
99
96
100
97
The following email clients are known to be supported:
`"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><div><h1 style="font-weight:500;padding-top:20px;font-size:2.5rem" data-id="react-email-heading">Hello, World!</h1></div>"`
9
+
`"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><div><h1 style="font-weight:500;padding-top:20px;font-size:2.5rem">Hello, World!</h1></div>"`
@@ -134,7 +134,7 @@ This is ~~striked~~ text and \`inline code\``;
134
134
<p>This is <del>striked</del> text and <code style="color:#212529;font-size:87.5%;display:inline;background: #f8f8f8;font-family:SFMono-Regular,Menlo,Monaco,Consolas,monospace;word-wrap:break-word">inline code</code></p>
135
135
`;
136
136
137
-
constrendered=parseMarkdownToReactEmailJSX({
137
+
constrendered=parseMarkdownToJSX({
138
138
markdown,
139
139
});
140
140
expect(rendered).toBe(expected);
@@ -166,7 +166,7 @@ Here is an ordered list:
166
166
</ol>
167
167
`;
168
168
169
-
constrendered=parseMarkdownToReactEmailJSX({
169
+
constrendered=parseMarkdownToJSX({
170
170
markdown,
171
171
});
172
172
expect(rendered).toBe(expected);
@@ -199,7 +199,7 @@ Here is an ordered list:
199
199
</tbody></table>
200
200
`;
201
201
202
-
constrendered=parseMarkdownToReactEmailJSX({
202
+
constrendered=parseMarkdownToJSX({
203
203
markdown,
204
204
});
205
205
expect(rendered).toBe(expected);
@@ -224,7 +224,7 @@ greet("World")
224
224
</code></pre>
225
225
`;
226
226
227
-
constrendered=parseMarkdownToReactEmailJSX({
227
+
constrendered=parseMarkdownToJSX({
228
228
markdown,
229
229
});
230
230
expect(rendered).toBe(expected);
@@ -242,7 +242,7 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
242
242
</blockquote>
243
243
`;
244
244
245
-
constrendered=parseMarkdownToReactEmailJSX({
245
+
constrendered=parseMarkdownToJSX({
246
246
markdown,
247
247
});
248
248
expect(rendered).toBe(expected);
@@ -256,7 +256,7 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
@@ -270,7 +270,7 @@ Here's a link to [OpenAI\'s website](https://openai.com/).`;
270
270
Here's a link to <a href="https://openai.com/" target="_blank" style="color:#007bff;text-decoration:underline;background-color:transparent">OpenAI's website</a>.</p>
0 commit comments