Skip to content

Commit 16cb56b

Browse files
committed
Vue component / es2015 module
1 parent 0211f26 commit 16cb56b

File tree

6 files changed

+95
-15
lines changed

6 files changed

+95
-15
lines changed

.babelrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
"presets": [
33
["env", { "modules": false }],
44
"stage-3"
5-
]
5+
],
6+
"plugins": ["lodash"]
67
}

README.md

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,44 @@
11
# Markdown*Palettes
22

3-
> Markdown*Palettes: Markdown editor for the modern web.
3+
**Markdown*Palettes** is an open-source Markdown editor for the modern web.
44

5-
**Markdown*Palettes** 是一款开源的Markdown编辑器,基于以下项目构建:
5+
### Usage
66

7-
- [Vue.js](https://github.com/vuejs/vue)
8-
- [marked](https://github.com/chjj/marked)
9-
- [katex](https://github.com/Khan/KaTeX)
10-
- [font-awesome](https://github.com/FortAwesome/Font-Awesome)
11-
- [lodash](https://github.com/lodash/lodash)
7+
#### Directly use js release
128

13-
#### 体验
14-
1. git clone https://github.com/luogu-dev/markdown-palettes.git
15-
2. cd ./markdown-palettes
16-
3. npm install
17-
4. npm run dev
9+
Get the latest [release](https://github.com/luogu-dev/markdown-palettes/releases).
10+
11+
````html
12+
<div id="editor"></div>
13+
<script>
14+
var markdownEditor = new MarkdownPalettes("#editor");
15+
markdownEditor.editor.setCode("# 233");
16+
var code = markdownEditor.editor.getCode();
17+
</script>
18+
````
19+
20+
#### Use as a Vue component
21+
````html
22+
<div>
23+
<markdown-palettes v-model="code"></markdown-palettes>
24+
</div>
25+
26+
<script>
27+
import Editor from 'markdown-palettes'
28+
export default {
29+
components: {
30+
Editor
31+
}
32+
}
33+
</script>
34+
````
35+
36+
#### Development
37+
```bash
38+
$ npm install
39+
$ npm run dev
40+
```
41+
42+
### Credits
43+
44+
Developed by @darkflames and @lin_toto of the Luogu Dev Team

package-lock.json

Lines changed: 48 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"version": "0.0.1",
55
"author": "Luogu Dev Team",
66
"license": "MIT",
7-
"private": true,
7+
"module": "src/module.js",
88
"scripts": {
99
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot",
1010
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules",
@@ -32,6 +32,7 @@
3232
"babel-core": "^6.26.0",
3333
"babel-eslint": "^8.2.1",
3434
"babel-loader": "^7.1.2",
35+
"babel-plugin-lodash": "^3.3.2",
3536
"babel-preset-env": "^1.6.0",
3637
"babel-preset-stage-3": "^6.24.1",
3738
"clean-webpack-plugin": "^0.1.17",

src/module.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import Editor from './components/MarkdownPalettes.vue'
2+
3+
export default Editor

webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ module.exports = {
4343
test: /\.(png|jpg|gif|svg|ttf|eot|woff|woff2)$/,
4444
loader: 'url-loader',
4545
options: {
46-
limit: 20480,
46+
limit: 5000,
4747
name: '[name].[ext]?[hash]'
4848
}
4949
}

0 commit comments

Comments
 (0)