-
Notifications
You must be signed in to change notification settings - Fork 19
/
index.html
169 lines (147 loc) · 3.26 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta charset="UTF-8">
<meta name="google" content="notranslate"/>
<style type="text/css">
* {
box-sizing: border-box;
}
html, body {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
overflow: hidden;
}
hr {
margin: 1em 0;
border: 0;
border-bottom: 1px solid #ccc;
}
blockquote {
margin-left: 0;
padding: 0.5em 0 0.5em 2em;
border-left: 3px solid rgb(211, 218, 234);
}
li, code {
margin: 0.4em 0;
}
p {
margin: 0.9em 0;
}
code {
background: rgba(211, 218, 234, 0.25);
}
pre > code {
display: block;
padding: 0.5em 4em;
}
table {
border-spacing: 0;
border-collapse: collapse;
}
td {
padding: 4px 8px;
}
tr:nth-child(2n) {
background: #f3f3f3;
}
th {
border-bottom: 1px solid #aaa;
}
img {
max-width: 96px;
}
.plain, .markdown {
position: absolute;
width: 50%;
height: 100%;
margin: 0;
}
.plain {
border: 0;
border-right: 1px solid #000;
padding: 12px;
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
font-size: 12px;
resize: none;
}
.markdown {
left: 50%;
padding: 0 0 0 12px;
overflow: auto;
font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;
font-size: 14px;
line-height: 1.3;
}
</style>
<title>drawdown test</title>
</head>
<body>
<textarea class="plain">
# drawdown
---
Tiny but reliable Markdown to HTML conversion in JavaScript
Supported Markdown features:
#### Headings
Inline styles such as **bold**, *italic*, ***both***, ~~strikethrough~~, `monospace`, --subscript--, and ^^superscript^^.
> Block quotes, including
> > nested block quotes.
```
Fenced code blocks
```
Indented code blocks
1. Numbered lists
- Unordered lists
- Nested in other lists
a. Lettered lists are an extension to the spec.
b. They may be useful for legal documents.
2. Another entry in my numbered list.
| Tables | Tables | Tables |
| ------ | ------ | ------ |
| Cell 1 | Cell 2 | Cell 3 |
| Cell 4 | Cell 5 | Cell 6 |
| Cell 7 | Cell 8 | Cell 9 |
[Links](https://github.com/adamvleggett/drawdown)
Images:
![Images](https://img.icons8.com/ios/452/stack-of-photos.png)
---
### Summary...
These are the supported features:
- Block quotes
- Code blocks
- Links
- Images
- Headings
- Lists (including lettered lists)
- Bold
- Italic
- Strikethrough
- Monospace
- Subscript
- Horizontal rule
- Tables
Unsupported Markdown features at this time:
- Line blocks
- Definition lists
- Footnotes
- Twitter/Facebook/YouTube embed
- Inline math equations
To use:
element.innerHTML = markdown(text);
</textarea>
<div class="markdown"></div>
<script type="text/javascript" src="drawdown.js"></script>
<script type="text/javascript">
var ein = document.querySelector(".plain");
var eout = document.querySelector(".markdown");
function update() {
eout.innerHTML = markdown(ein.value);
}
ein.addEventListener("input", update);
update();
</script>
</body>
</html>