mirror of
https://github.com/sparksuite/simplemde-markdown-editor.git
synced 2025-07-30 05:14:28 -06:00
finish basic setting
This commit is contained in:
parent
6abda7ab68
commit
2fde407c65
BIN
._gulpfile.js
Normal file
BIN
._gulpfile.js
Normal file
Binary file not shown.
BIN
._package.json
Normal file
BIN
._package.json
Normal file
Binary file not shown.
22578
debug/simplemde.debug.js
22578
debug/simplemde.debug.js
File diff suppressed because one or more lines are too long
22575
debug/simplemde.js
22575
debug/simplemde.js
File diff suppressed because it is too large
Load Diff
BIN
dist/._index.html
vendored
Normal file
BIN
dist/._index.html
vendored
Normal file
Binary file not shown.
21
dist/index.html
vendored
Normal file
21
dist/index.html
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>SimpleMDE Markdown Editor Local Test</title>
|
||||
<link rel="stylesheet" href="./simplemde.min.css">
|
||||
<style>
|
||||
.CodeMirror, .CodeMirror-scroll {
|
||||
min-height: 200px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div>let's start</div>
|
||||
<textarea class="simeplemde" id="MyID"></textarea>
|
||||
<script src="./simplemde.min.js"></script>
|
||||
<script>
|
||||
var simplemde = new SimpleMDE({ element: document.getElementById("MyID") });
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
10
dist/simplemde.min.js
vendored
10
dist/simplemde.min.js
vendored
File diff suppressed because one or more lines are too long
91
gulpfile.js
91
gulpfile.js
@ -7,12 +7,12 @@ var gulp = require("gulp"),
|
||||
header = require("gulp-header"),
|
||||
buffer = require("vinyl-buffer"),
|
||||
pkg = require("./package.json"),
|
||||
debug = require("gulp-debug"),
|
||||
eslint = require("gulp-eslint"),
|
||||
prettify = require("gulp-jsbeautifier"),
|
||||
browserify = require("browserify"),
|
||||
source = require("vinyl-source-stream"),
|
||||
rename = require("gulp-rename");
|
||||
rename = require("gulp-rename"),
|
||||
browserSync = require('browser-sync').create();
|
||||
|
||||
var banner = ["/**",
|
||||
" * <%= pkg.name %> v<%= pkg.version %>",
|
||||
@ -22,75 +22,98 @@ var banner = ["/**",
|
||||
" */",
|
||||
""].join("\n");
|
||||
|
||||
gulp.task("prettify-js", [], function() {
|
||||
function prettifyJs() {
|
||||
return gulp.src("./src/js/simplemde.js")
|
||||
.pipe(prettify({js: {brace_style: "collapse", indent_char: "\t", indent_size: 1, max_preserve_newlines: 3, space_before_conditional: false}}))
|
||||
.pipe(prettify({ js: { brace_style: "collapse", indent_char: "\t", indent_size: 1, max_preserve_newlines: 3, space_before_conditional: false } }))
|
||||
.pipe(gulp.dest("./src/js"));
|
||||
});
|
||||
|
||||
gulp.task("prettify-css", [], function() {
|
||||
return gulp.src("./src/css/simplemde.css")
|
||||
.pipe(prettify({css: {indentChar: "\t", indentSize: 1}}))
|
||||
.pipe(gulp.dest("./src/css"));
|
||||
});
|
||||
}
|
||||
|
||||
gulp.task("lint", ["prettify-js"], function() {
|
||||
gulp.src("./src/js/**/*.js")
|
||||
.pipe(debug())
|
||||
.pipe(eslint())
|
||||
function prettifyCss() {
|
||||
return gulp.src("./src/css/simplemde.css")
|
||||
.pipe(prettify({ css: { indentChar: "\t", indentSize: 1 } }))
|
||||
.pipe(gulp.dest("./src/css"));
|
||||
}
|
||||
|
||||
function lint() {
|
||||
return gulp.src("./src/js/**/*.js")
|
||||
// .pipe(eslint({ fix: true })) // 자동 수정 옵션 추가
|
||||
.pipe(eslint.format())
|
||||
.pipe(eslint.failAfterError());
|
||||
});
|
||||
}
|
||||
|
||||
function taskBrowserify(opts) {
|
||||
return browserify("./src/js/simplemde.js", opts)
|
||||
.bundle();
|
||||
}
|
||||
|
||||
gulp.task("browserify:debug", ["lint"], function() {
|
||||
return taskBrowserify({debug:true, standalone:"SimpleMDE"})
|
||||
function browserifyDebug() {
|
||||
return taskBrowserify({ debug: true, standalone: "SimpleMDE" })
|
||||
.pipe(source("simplemde.debug.js"))
|
||||
.pipe(buffer())
|
||||
.pipe(header(banner, {pkg: pkg}))
|
||||
.pipe(header(banner, { pkg: pkg }))
|
||||
.pipe(gulp.dest("./debug/"));
|
||||
});
|
||||
}
|
||||
|
||||
gulp.task("browserify", ["lint"], function() {
|
||||
return taskBrowserify({standalone:"SimpleMDE"})
|
||||
function browserifyTask() {
|
||||
return taskBrowserify({ standalone: "SimpleMDE" })
|
||||
.pipe(source("simplemde.js"))
|
||||
.pipe(buffer())
|
||||
.pipe(header(banner, {pkg: pkg}))
|
||||
.pipe(header(banner, { pkg: pkg }))
|
||||
.pipe(gulp.dest("./debug/"));
|
||||
});
|
||||
}
|
||||
|
||||
gulp.task("scripts", ["browserify:debug", "browserify", "lint"], function() {
|
||||
function scripts() {
|
||||
var js_files = ["./debug/simplemde.js"];
|
||||
|
||||
|
||||
return gulp.src(js_files)
|
||||
.pipe(concat("simplemde.min.js"))
|
||||
.pipe(uglify())
|
||||
.pipe(buffer())
|
||||
.pipe(header(banner, {pkg: pkg}))
|
||||
.pipe(header(banner, { pkg: pkg }))
|
||||
.pipe(gulp.dest("./dist/"));
|
||||
});
|
||||
}
|
||||
|
||||
gulp.task("styles", ["prettify-css"], function() {
|
||||
function styles() {
|
||||
var css_files = [
|
||||
"./node_modules/codemirror/lib/codemirror.css",
|
||||
"./src/css/*.css",
|
||||
"./node_modules/codemirror-spell-checker/src/css/spell-checker.css"
|
||||
];
|
||||
|
||||
|
||||
return gulp.src(css_files)
|
||||
.pipe(concat("simplemde.css"))
|
||||
.pipe(buffer())
|
||||
.pipe(header(banner, {pkg: pkg}))
|
||||
.pipe(header(banner, { pkg: pkg }))
|
||||
.pipe(gulp.dest("./debug/"))
|
||||
.pipe(minifycss())
|
||||
.pipe(rename("simplemde.min.css"))
|
||||
.pipe(buffer())
|
||||
.pipe(header(banner, {pkg: pkg}))
|
||||
.pipe(header(banner, { pkg: pkg }))
|
||||
.pipe(gulp.dest("./dist/"));
|
||||
});
|
||||
}
|
||||
|
||||
gulp.task("default", ["scripts", "styles"]);
|
||||
function serve() {
|
||||
browserSync.init({
|
||||
server: {
|
||||
baseDir: "./dist"
|
||||
},
|
||||
port: 3000
|
||||
});
|
||||
|
||||
//gulp.watch("src/**/*.js", gulp.series(browserifyDebug, scripts));
|
||||
//gulp.watch("src/**/*.js", gulp.series(prettifyJs, lint, browserifyDebug, browserifyTask, scripts)).on;
|
||||
//gulp.watch("src/**/*.js", gulp.series(prettifyJs, lint, browserifyDebug, browserifyTask, scripts)).on('change', browserSync.reload);
|
||||
gulp.watch("src/js/simplemde.js", gulp.series(lint, browserifyDebug, browserifyTask, scripts))
|
||||
gulp.watch("src/**/*.css", gulp.series(prettifyCss, styles));
|
||||
gulp.watch(["dist/**/*"]).on('change', browserSync.reload);
|
||||
}
|
||||
|
||||
gulp.task("prettify-js", prettifyJs);
|
||||
gulp.task("prettify-css", prettifyCss);
|
||||
gulp.task("lint", gulp.series(prettifyJs, lint));
|
||||
gulp.task("browserify:debug", gulp.series("lint", browserifyDebug));
|
||||
gulp.task("browserify", gulp.series("lint", browserifyTask));
|
||||
gulp.task("scripts", gulp.series("browserify:debug", "browserify", scripts));
|
||||
gulp.task("styles", gulp.series("prettify-css", styles));
|
||||
gulp.task("serve", serve);
|
||||
gulp.task("default", gulp.series("scripts", "styles"));
|
7641
package-lock.json
generated
Normal file
7641
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
15
package.json
15
package.json
@ -20,26 +20,29 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/NextStepWebs/simplemde-markdown-editor/issues"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "gulp serve"
|
||||
},
|
||||
"dependencies": {
|
||||
"codemirror": "*",
|
||||
"codemirror-spell-checker": "*",
|
||||
"marked": "*"
|
||||
"codemirror": "^5.65.16",
|
||||
"codemirror-spell-checker": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"browser-sync": "^3.0.2",
|
||||
"browserify": "*",
|
||||
"debug": "*",
|
||||
"eslint": "*",
|
||||
"gulp": "*",
|
||||
"gulp-clean-css": "*",
|
||||
"gulp-concat": "*",
|
||||
"gulp-debug": "*",
|
||||
"gulp-eslint": "*",
|
||||
"gulp-header": "*",
|
||||
"gulp-jsbeautifier": "*",
|
||||
"gulp-clean-css": "*",
|
||||
"gulp-rename": "*",
|
||||
"gulp-uglify": "*",
|
||||
"vinyl-source-stream": "*",
|
||||
"vinyl-buffer": "*"
|
||||
"vinyl-buffer": "*",
|
||||
"vinyl-source-stream": "*"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
BIN
src/js/._simplemde.js
Normal file
BIN
src/js/._simplemde.js
Normal file
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user