-
-
Notifications
You must be signed in to change notification settings - Fork 180
/
Copy pathindex.html
84 lines (70 loc) · 2.57 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE html>
<html>
<head>
<title>markdown-to-jsx: try it live!</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&family=JetBrains+Mono&display=swap"
rel="stylesheet"
/>
<link
href="https://unpkg.com/[email protected]/dist/katex.min.css"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="https://unpkg.com/@highlightjs/[email protected]/styles/nord.min.css"
/>
<script
crossorigin
src="https://unpkg.com/react@18/umd/react.production.min.js"
></script>
<script
crossorigin
src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"
></script>
<script
crossorigin
src="https://unpkg.com/styled-components@6/dist/styled-components.min.js"
></script>
<script
crossorigin
src="https://unpkg.com/[email protected]/dist/katex.js"
></script>
<script
crossorigin
src="https://unpkg.com/@highlightjs/[email protected]/highlight.min.js"
></script>
</head>
<body>
<div id="root"></div>
<!-- prettier-ignore -->
<script type="text/plain" id="sample-content">
# This is Markdown
✨ You can edit me! ✨
[Markdown](http://daringfireball.net/projects/markdown/) lets you write content in a really natural way.
* You can have lists, like this one
* Make things **bold** or *italic*
* Embed snippets of `code`
* Create [links](/)
* ...
<small>Sample content borrowed with thanks from [elm-markdown](http://elm-lang.org/examples/markdown) ❤️</small>
> [!Tip]
> Normal and "alert" blockquotes are possible. Use `renderRule` for more control if needed.
Custom handling of code blocks (or any rule!) is possible with the [`renderRule` option](https://github.com/quantizor/markdown-to-jsx#optionsrenderrule). For example, LaTeX support via [`@matejmazur/react-katex`](https://www.npmjs.com/package/@matejmazur/react-katex):
```latex
\mathbb{N} = \{ a \in \mathbb{Z} : a > 0 \}
```
Or any other typical language, using [`highlight.js`](https://highlightjs.org/):
```javascript
function App() {
return <div>Hello world!</div>;
}
```
You can even include custom React components if you declare them in the [`overrides` option](https://github.com/quantizor/markdown-to-jsx/blob/main/README.md#optionsoverrides---rendering-arbitrary-react-components).
<MyComponent>Isn't that cool?</MyComponent>
</script>
<script src="./markdown-to-jsx.js"></script>
</body>
</html>