forked from pandao/editor.md
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Pandao
committed
Feb 5, 2015
1 parent
a6376c0
commit 4b4a6ed
Showing
344 changed files
with
72,327 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,12 @@ | ||
# Logs | ||
logs | ||
*.log | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directory | ||
# Commenting this out is preferred by some people, see | ||
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- | ||
node_modules | ||
|
||
# Users Environment Variables | ||
.lock-wscript | ||
node_modules/ | ||
.sass-cache/ | ||
test/ | ||
backup/ | ||
*.bat | ||
*.sh | ||
.project | ||
.url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"esnext": true, | ||
"bitwise": true, | ||
"camelcase": true, | ||
"curly": true, | ||
"eqeqeq": true, | ||
"immed": true, | ||
"indent": 4, | ||
"latedef": true, | ||
"newcap": true, | ||
"noarg": true, | ||
"quotmark": "double", | ||
"regexp": true, | ||
"undef": true, | ||
"unused": true, | ||
"strict": true, | ||
"trailing": true, | ||
"smarttabs": true, | ||
"white": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#Bugs | ||
|
||
> 说明:删除线表示已经解决。 | ||
####IE8 | ||
|
||
- ~~不能加载~~ | ||
- flowChart(流程图)、sequenceDiagram(序列图)不支持IE8 | ||
|
||
####Sea.js | ||
|
||
- Raphael.js无法加载 | ||
|
||
####Require.js | ||
|
||
- CodeMirror编辑器的代码无法高亮 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
####更新日志 | ||
|
||
#####v1.0.0 | ||
|
||
基本功能完成; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
'use strict'; | ||
|
||
var gulp = require('gulp'); | ||
var gutil = require("gulp-util"); | ||
var sass = require('gulp-ruby-sass'); | ||
var jshint = require('gulp-jshint'); | ||
var uglify = require('gulp-uglify'); | ||
var rename = require('gulp-rename'); | ||
var concat = require('gulp-concat'); | ||
var notify = require('gulp-notify'); | ||
var header = require('gulp-header'); | ||
var minifycss = require('gulp-minify-css'); | ||
var autoprefixer = require('gulp-autoprefixer'); | ||
var jsdoc = require("gulp-jsdoc"); | ||
var jsdoc2md = require("gulp-jsdoc-to-markdown"); | ||
var pkg = require('./package.json'); | ||
var dateFormat = require('dateformatter').format; | ||
|
||
pkg.name = "Editor.md"; | ||
pkg.today = dateFormat; | ||
|
||
var headerComment = ["/*", | ||
" * <%= pkg.name %>", | ||
" * @file <%= fileName(file) %> ", | ||
" * @version v<%= pkg.version %> ", | ||
" * @description <%= pkg.description %>", | ||
" * @license MIT License", | ||
" * @author <%= pkg.author %>", | ||
" * {@link <%= pkg.homepage %>}", | ||
" * @updateTime <%= pkg.today('Y-m-d') %>", | ||
" */", | ||
"\r\n"].join("\r\n"); | ||
|
||
var headerMiniComment = "/*! <%= pkg.name %> v<%= pkg.version %> | <%= fileName(file) %> | <%= pkg.description %> | MIT License | By: <%= pkg.author %> | <%= pkg.homepage %> | <%=pkg.today('Y-m-d') %> */\r\n"; | ||
|
||
var scssTask = function(fileName, path) { | ||
|
||
path = path || 'src/scss/'; | ||
|
||
return gulp.src(path + fileName + ".scss") | ||
.pipe(sass({ style: 'expanded' })) //nested,compact,expanded,compressed | ||
//.pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4')) | ||
.pipe(gulp.dest('dist/css')) | ||
.pipe(header(headerComment, {pkg : pkg, fileName : function(file) { | ||
var name = file.path.split(file.base); | ||
return name[1].replace('\\', ''); | ||
}})) | ||
.pipe(gulp.dest('dist/css')) | ||
.pipe(rename({ suffix: '.min' })) | ||
.pipe(gulp.dest('dist/css')) | ||
.pipe(minifycss()) | ||
.pipe(gulp.dest('dist/css')) | ||
.pipe(header(headerMiniComment, {pkg : pkg, fileName : function(file) { | ||
var name = file.path.split(file.base); | ||
return name[1].replace('\\', ''); | ||
}})) | ||
.pipe(gulp.dest('dist/css')) | ||
.pipe(notify({ message: fileName + '.scss task completed!' })); | ||
}; | ||
|
||
gulp.task('scss', function() { | ||
return scssTask('editormd'); | ||
}); | ||
|
||
gulp.task('scss2', function() { | ||
return scssTask('editormd.preview'); | ||
}); | ||
|
||
gulp.task('js', function() { | ||
return gulp.src('src/js/editormd.js') | ||
.pipe(jshint('./.jshintrc')) | ||
.pipe(jshint.reporter('default')) | ||
//.pipe(concat('all.js')) | ||
//.pipe(gulp.dest('dist/js')) | ||
.pipe(header(headerComment, {pkg : pkg, fileName : function(file) { | ||
var name = file.path.split(file.base); | ||
return name[1].replace('\\', ''); | ||
}})) | ||
.pipe(gulp.dest('dist/js')) | ||
.pipe(rename({ suffix: '.min' })) | ||
.pipe(uglify()) | ||
.pipe(gulp.dest('dist/js')) | ||
.pipe(header(headerMiniComment, {pkg : pkg, fileName : function(file) { | ||
var name = file.path.split(file.base + "\\"); | ||
return name[1].replace('\\', ''); | ||
}})) | ||
.pipe(gulp.dest('dist/js')) | ||
.pipe(notify({ message: 'js task complete' })); | ||
}); | ||
|
||
gulp.task("jsdoc", function(){ | ||
return gulp.src(["./src/editormd.js", "README.md"]) | ||
.pipe(jsdoc.parser()) | ||
.pipe(jsdoc.generator('./docs/html')); | ||
}); | ||
|
||
gulp.task("jsdoc2md", function() { | ||
return gulp.src("src/js/editormd.js") | ||
.pipe(jsdoc2md()) | ||
.on("error", function(err){ | ||
gutil.log(gutil.colors.red("jsdoc2md failed"), err.message) | ||
}) | ||
.pipe(rename(function(path) { | ||
path.extname = ".md"; | ||
})) | ||
.pipe(gulp.dest("docs/markdown")); | ||
}); | ||
|
||
gulp.task('watch', function() { | ||
gulp.watch('src/scss/editormd.scss', ['scss']); | ||
gulp.watch('src/scss/editormd.preview.scss', ['scss2']); | ||
gulp.watch('src/js/editormd.js', ['js']); | ||
}); | ||
|
||
gulp.task('default', function() { | ||
gulp.run('scss'); | ||
gulp.run('scss2'); | ||
gulp.run('js'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,72 @@ | ||
# editor.md | ||
# Editor.md | ||
|
||
A simple online markdown editor. | ||
|
||
**Editor.md** 是一个基于jQuery和CodeMirror构建的在线Markdown文档编辑器。 | ||
|
||
![editormd-screenshot](https://pandao.github.io/editor.md/examples/images/editormd-screenshot.png "editormd-screenshot") | ||
|
||
####主要特性 | ||
|
||
- 支持Markdown标准和Github风格; | ||
- 支持实时预览和多语言语法高亮; | ||
- 支持AMD/CMD模块化加载(支持Require.js & Sea.js); | ||
- 兼容主流的浏览器(IE8+),且支持iPad等平板设备; | ||
- 支持流程图 `flowchart` 和时序图 `sequenceDiagram`; | ||
|
||
####在线演示 | ||
|
||
[https://pandao.github.io/editor.md/examples/index.html](https://pandao.github.io/examples/index.html) | ||
|
||
####下载和安装 | ||
|
||
通过Github下载安装,或者通过bower安装: | ||
|
||
bower install editor.md | ||
|
||
####使用方法 | ||
|
||
HTML: | ||
|
||
<div class="editormd" id="test-editormd"> | ||
<script type="text/markdown">###Hello world!</script> | ||
</div> | ||
|
||
javascript: | ||
|
||
<link rel="stylesheet" href="../dist/css/editormd.css" /> | ||
<script src="../lib/jquery.min.js"></script> | ||
<script src="../src/js/editormd.js"></script> | ||
<script type="text/javascript"> | ||
$(function() { | ||
var testEditor = editormd("test-editormd", { | ||
path : '../lib/' | ||
}); | ||
}); | ||
}); | ||
</script> | ||
|
||
> Require.js的使用方法:[https://github.com/pandao/editor.md/examples/use-requirejs.html](https://github.com/pandao/editor.md/examples/use-requirejs.html) | ||
> Sea.js的使用方法:[https://github.com/pandao/editor.md/examples/use-seajs.html](https://github.com/pandao/editor.md/examples/use-seajs.html) | ||
####依赖项目及感谢 | ||
|
||
- [CodeMirror](http://codemirror.net/ "CodeMirror") | ||
- [marked](https://github.com/chjj/marked "marked") | ||
- [jQuery](http://jquery.com/ "jQuery") | ||
- [FontAwesome](http://fontawesome.io/ "FontAwesome") | ||
- [github-markdown.css](https://github.com/sindresorhus/github-markdown-css "github-markdown.css") | ||
- [prettify.js](http://code.google.com/p/google-code-prettify/ "prettify.js") | ||
- [flowchart.js](http://adrai.github.io/flowchart.js/ "flowchart.js") | ||
- [sequence-diagram.js](http://bramp.github.io/js-sequence-diagrams/ "sequence-diagram.js") | ||
|
||
####更新日志 | ||
|
||
[查看更新日志](https://github.com/pandao/editor.md/blob/master/CHANGE.md) | ||
|
||
####License | ||
|
||
The MIT License. | ||
|
||
Copyright (c) 2015 Pandao |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"name": "editor.md", | ||
"version": "1.0.0", | ||
"homepage": "https://github.com/pandao/editor.md", | ||
"authors": [ | ||
"Pandao <pandao@vip.qq.com>" | ||
], | ||
"description": "A simple online markdown editor.", | ||
"keywords": [ | ||
"editor.md", | ||
"markdown", | ||
"editor" | ||
], | ||
"license": "MIT", | ||
"ignore": [ | ||
"**/.*", | ||
"research", | ||
"docs", | ||
"node_modules", | ||
"bower_components", | ||
"test", | ||
"tests" | ||
] | ||
} |
Oops, something went wrong.