-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
63 lines (61 loc) · 1.81 KB
/
demo.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Markdown Style</title>
<script src="https://unpkg.com/@wcj/dark-mode"></script>
<script src="https://unpkg.com/@wcj/markdown-to-html/dist/markdown.min.js"></script>
<script type="module" src="https://unpkg.com/@uiw/github-corners?module"></script>
<script src="./lib/index.js?module"></script>
<style>
body {
max-width: 890px;
margin: 0 auto;
padding: 0 15px;
padding-bottom: 230px;
padding-top: 120px;
}
</style>
</head>
<body>
<dark-mode light="Light" dark="Dark" style="position: fixed; left: 10px; top: 8px;"></dark-mode>
<github-corners target="__blank" href="https://github.com/jaywcjlove/markdown-style"></github-corners>
<h1>Markdown Style Example</h1>
<markdown-style theme-auto-switch-disabled="true" style="max-width: 520px; border: 1px solid #506d9b3b; padding: 10px;">
```jsx
import React from 'react';
import 'markdown-style';
function Demo() {
return (
<markdown-style>
<h1>Markdown Style</h1>
</markdown-style>
);
}
```
```css
body {
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";
}
a {
color: var(--color-theme-text);
}
```
</markdown-style>
<script>
;(() => {
const mdstr = document.querySelector('markdown-style');
mdstr.innerHTML = markdown.default(mdstr.innerHTML);
})();
</script>
<markdown-style name="document"><%= markdownString %></markdown-style>
<script>
;(() => {
const mdstr = document.querySelector("[name='document']");
mdstr.innerHTML = markdown.default(mdstr.textContent);
})();
</script>
</body>
</html>