Skip to content

Commit b6cb254

Browse files
committed
Initial commit with the basics
1 parent 612fd7e commit b6cb254

11 files changed

+4686
-1
lines changed

.babelrc

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"env": {
3+
"esm": {
4+
"plugins": [
5+
"transform-object-rest-spread",
6+
"transform-custom-element-classes"
7+
],
8+
"presets": [
9+
["flow"],
10+
["es2015", {"modules": false}],
11+
]
12+
},
13+
"umd": {
14+
"plugins": [
15+
"transform-object-rest-spread",
16+
"transform-custom-element-classes",
17+
"transform-es2015-modules-umd"
18+
],
19+
"presets": ["flow", "es2015"]
20+
}
21+
}
22+
}

.eslintrc.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": [
3+
"plugin:github/es6",
4+
"plugin:github/browser",
5+
"plugin:github/flow"
6+
]
7+
}

.flowconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[ignore]
2+
3+
[include]
4+
5+
[libs]
6+
7+
[options]
8+
9+
[lints]

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist
2+
node_modules

LICENSE

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2017-2018 GitHub, Inc.
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
SOFTWARE.

README.md

+50-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,50 @@
1-
# markdown-toolbar-element
1+
# <markdown-toolbar> element
2+
3+
markdown-toolbar buttons for textareas.
4+
5+
## Installation
6+
7+
```
8+
$ npm install --save @github/markdown-toolbar-element
9+
```
10+
11+
## Usage
12+
13+
```js
14+
import '@github/markdown-toolbar-element'
15+
```
16+
17+
```html
18+
<markdown-toolbar for="textarea_id">
19+
<md-bold>bold</md-bold>
20+
<md-header>header</md-header>
21+
<md-italic>italic</md-italic>
22+
<md-quote>quote</md-quote>
23+
<md-code>code</md-code>
24+
<md-link>link</md-link>
25+
<md-unordered-list>unordered-list</md-unordered-list>
26+
<md-ordered-list>ordered-list</md-ordered-list>
27+
<md-task-list>task-list</md-task-list>
28+
<md-mention>mention</md-mention>
29+
<md-ref>ref</md-ref>
30+
</markdown-toolbar>
31+
<textarea id="textarea_id"></textarea>
32+
```
33+
34+
## Browser support
35+
36+
- Chrome
37+
- Firefox
38+
- Safari 9+
39+
- Internet Explorer 11
40+
- Microsoft Edge
41+
42+
## Development
43+
44+
```
45+
npm install
46+
```
47+
48+
## License
49+
50+
Distributed under the MIT license. See LICENSE for details.

examples/index.html

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<title>markdown-toolbar examples</title>
5+
<link href="https://unpkg.com/primer@latest/build/build.css" rel="stylesheet">
6+
</head>
7+
<body>
8+
<div class="container py-4">
9+
<markdown-toolbar for="textarea">
10+
<md-bold class="btn btn-sm">bold</md-bold>
11+
<md-header class="btn btn-sm">header</md-header>
12+
<md-italic class="btn btn-sm">italic</md-italic>
13+
<md-quote class="btn btn-sm">quote</md-quote>
14+
<md-code class="btn btn-sm">code</md-code>
15+
<md-link class="btn btn-sm">link</md-link>
16+
<md-unordered-list class="btn btn-sm">unordered-list</md-unordered-list>
17+
<md-ordered-list class="btn btn-sm">ordered-list</md-ordered-list>
18+
<md-task-list class="btn btn-sm">task-list</md-task-list>
19+
<md-mention class="btn btn-sm">mention</md-mention>
20+
<md-ref class="btn btn-sm">ref</md-ref>
21+
</markdown-toolbar>
22+
<textarea class="mt-3 d-block width-full" id="textarea"></textarea>
23+
</div>
24+
<script src="../dist/index.umd.js"></script>
25+
</body>
26+
</html>

0 commit comments

Comments
 (0)