Browse Source

Update Code block style & Source code reformat

develop
pandao 6 years ago
parent
commit
506472d3aa
  1. 684
      Gulpfile.js
  2. 50
      css/editormd.css
  3. 2
      css/editormd.min.css
  4. 36
      css/editormd.preview.css
  5. 2
      css/editormd.preview.min.css
  6. 666
      scss/editormd.preview.scss
  7. 282
      scss/editormd.preview.themes.scss
  8. 56
      scss/editormd.themes.scss
  9. 2
      scss/prettify.scss

684
Gulpfile.js

@ -1,342 +1,342 @@
"use strict";
var os = require("os");
var gulp = require("gulp");
var gutil = require("gulp-util");
var sass = require("gulp-ruby-sass");
var jshint = require("gulp-jshint");
var uglify = require("gulp-uglifyjs");
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 jsdoc = require("gulp-jsdoc");
//var jsdoc2md = require("gulp-jsdoc-to-markdown");
var pkg = require("./package.json");
var dateFormat = require("dateformatter").format;
var replace = require("gulp-replace");
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 || "scss/";
var distPath = "css";
return sass(path + fileName + ".scss", { style: "expanded", sourcemap: false, noCache : true })
.pipe(gulp.dest(distPath))
.pipe(header(headerComment, {pkg : pkg, fileName : function(file) {
var name = file.path.split(file.base);
return name[1].replace("\\", "");
}}))
.pipe(gulp.dest(distPath))
.pipe(rename({ suffix: ".min" }))
.pipe(gulp.dest(distPath))
.pipe(minifycss())
.pipe(gulp.dest(distPath))
.pipe(header(headerMiniComment, {pkg : pkg, fileName : function(file) {
var name = file.path.split(file.base);
return name[1].replace("\\", "");
}}))
.pipe(gulp.dest(distPath))
.pipe(notify({ message: fileName + ".scss task completed!" }));
};
gulp.task("scss", function() {
return scssTask("editormd");
});
gulp.task("scss2", function() {
return scssTask("editormd.preview");
});
gulp.task("scss3", function() {
return scssTask("editormd.logo");
});
gulp.task("js", function() {
return gulp.src("./src/editormd.js")
.pipe(jshint("./.jshintrc"))
.pipe(jshint.reporter("default"))
.pipe(header(headerComment, {pkg : pkg, fileName : function(file) {
var name = file.path.split(file.base);
return name[1].replace(/[\\\/]?/, "");
}}))
.pipe(gulp.dest("./"))
.pipe(rename({ suffix: ".min" }))
.pipe(uglify()) // {outSourceMap: true, sourceRoot: './'}
.pipe(gulp.dest("./"))
.pipe(header(headerMiniComment, {pkg : pkg, fileName : function(file) {
var name = file.path.split(file.base + ( (os.platform() === "win32") ? "\\" : "/") );
return name[1].replace(/[\\\/]?/, "");
}}))
.pipe(gulp.dest("./"))
.pipe(notify({ message: "editormd.js task complete" }));
});
gulp.task("amd", function() {
var replaceText1 = [
'var cmModePath = "codemirror/mode/";',
' var cmAddonPath = "codemirror/addon/";',
'',
' var codeMirrorModules = [',
' "jquery", "marked", "prettify",',
' "katex", "raphael", "underscore", "flowchart", "jqueryflowchart", "sequenceDiagram",',
'',
' "codemirror/lib/codemirror",',
' cmModePath + "css/css",',
' cmModePath + "sass/sass",',
' cmModePath + "shell/shell",',
' cmModePath + "sql/sql",',
' cmModePath + "clike/clike",',
' cmModePath + "php/php",',
' cmModePath + "xml/xml",',
' cmModePath + "markdown/markdown",',
' cmModePath + "javascript/javascript",',
' cmModePath + "htmlmixed/htmlmixed",',
' cmModePath + "gfm/gfm",',
' cmModePath + "http/http",',
' cmModePath + "go/go",',
' cmModePath + "dart/dart",',
' cmModePath + "coffeescript/coffeescript",',
' cmModePath + "nginx/nginx",',
' cmModePath + "python/python",',
' cmModePath + "perl/perl",',
' cmModePath + "lua/lua",',
' cmModePath + "r/r", ',
' cmModePath + "ruby/ruby", ',
' cmModePath + "rst/rst",',
' cmModePath + "smartymixed/smartymixed",',
' cmModePath + "vb/vb",',
' cmModePath + "vbscript/vbscript",',
' cmModePath + "velocity/velocity",',
' cmModePath + "xquery/xquery",',
' cmModePath + "yaml/yaml",',
' cmModePath + "erlang/erlang",',
' cmModePath + "jade/jade",',
'',
' cmAddonPath + "edit/trailingspace", ',
' cmAddonPath + "dialog/dialog", ',
' cmAddonPath + "search/searchcursor", ',
' cmAddonPath + "search/search", ',
' cmAddonPath + "scroll/annotatescrollbar", ',
' cmAddonPath + "search/matchesonscrollbar", ',
' cmAddonPath + "display/placeholder", ',
' cmAddonPath + "edit/closetag", ',
' cmAddonPath + "fold/foldcode",',
' cmAddonPath + "fold/foldgutter",',
' cmAddonPath + "fold/indent-fold",',
' cmAddonPath + "fold/brace-fold",',
' cmAddonPath + "fold/xml-fold", ',
' cmAddonPath + "fold/markdown-fold",',
' cmAddonPath + "fold/comment-fold", ',
' cmAddonPath + "mode/overlay", ',
' cmAddonPath + "selection/active-line", ',
' cmAddonPath + "edit/closebrackets", ',
' cmAddonPath + "display/fullscreen",',
' cmAddonPath + "search/match-highlighter"',
' ];',
'',
' define(codeMirrorModules, factory);'
].join("\r\n");
var replaceText2 = [
"if (typeof define == \"function\" && define.amd) {",
" $ = arguments[0];",
" marked = arguments[1];",
" prettify = arguments[2];",
" katex = arguments[3];",
" Raphael = arguments[4];",
" _ = arguments[5];",
" flowchart = arguments[6];",
" CodeMirror = arguments[9];",
" }"
].join("\r\n");
gulp.src("src/editormd.js")
.pipe(rename({ suffix: ".amd" }))
.pipe(gulp.dest('./'))
.pipe(header(headerComment, {pkg : pkg, fileName : function(file) {
var name = file.path.split(file.base);
return name[1].replace(/[\\\/]?/, "");
}}))
.pipe(gulp.dest("./"))
.pipe(replace("/* Require.js define replace */", replaceText1))
.pipe(gulp.dest('./'))
.pipe(replace("/* Require.js assignment replace */", replaceText2))
.pipe(gulp.dest('./'))
.pipe(rename({ suffix: ".min" }))
.pipe(uglify()) //{outSourceMap: true, sourceRoot: './'}
.pipe(gulp.dest("./"))
.pipe(header(headerMiniComment, {pkg : pkg, fileName : function(file) {
var name = file.path.split(file.base + ( (os.platform() === "win32") ? "\\" : "/") );
return name[1].replace(/[\\\/]?/, "");
}}))
.pipe(gulp.dest("./"))
.pipe(notify({ message: "amd version task complete"}));
});
var codeMirror = {
path : {
src : {
mode : "lib/codemirror/mode",
addon : "lib/codemirror/addon"
},
dist : "lib/codemirror"
},
modes : [
"css",
"sass",
"shell",
"sql",
"clike",
"php",
"xml",
"markdown",
"javascript",
"htmlmixed",
"gfm",
"http",
"go",
"dart",
"coffeescript",
"nginx",
"python",
"perl",
"lua",
"r",
"ruby",
"rst",
"smartymixed",
"vb",
"vbscript",
"velocity",
"xquery",
"yaml",
"erlang",
"jade",
],
addons : [
"edit/trailingspace",
"dialog/dialog",
"search/searchcursor",
"search/search",
"scroll/annotatescrollbar",
"search/matchesonscrollbar",
"display/placeholder",
"edit/closetag",
"fold/foldcode",
"fold/foldgutter",
"fold/indent-fold",
"fold/brace-fold",
"fold/xml-fold",
"fold/markdown-fold",
"fold/comment-fold",
"mode/overlay",
"selection/active-line",
"edit/closebrackets",
"display/fullscreen",
"search/match-highlighter"
]
};
gulp.task("cm-mode", function() {
var modes = [
codeMirror.path.src.mode + "/meta.js"
];
for(var i in codeMirror.modes) {
var mode = codeMirror.modes[i];
modes.push(codeMirror.path.src.mode + "/" + mode + "/" + mode + ".js");
}
return gulp.src(modes)
.pipe(concat("modes.min.js"))
.pipe(gulp.dest(codeMirror.path.dist))
.pipe(uglify()) // {outSourceMap: true, sourceRoot: codeMirror.path.dist}
.pipe(gulp.dest(codeMirror.path.dist))
.pipe(header(headerMiniComment, {pkg : pkg, fileName : function(file) {
var name = file.path.split(file.base + "\\");
return (name[1]?name[1]:name[0]).replace(/\\/g, "");
}}))
.pipe(gulp.dest(codeMirror.path.dist))
.pipe(notify({ message: "codemirror-mode task complete!" }));
});
gulp.task("cm-addon", function() {
var addons = [];
for(var i in codeMirror.addons) {
var addon = codeMirror.addons[i];
addons.push(codeMirror.path.src.addon + "/" + addon + ".js");
}
return gulp.src(addons)
.pipe(concat("addons.min.js"))
.pipe(gulp.dest(codeMirror.path.dist))
.pipe(uglify()) //{outSourceMap: true, sourceRoot: codeMirror.path.dist}
.pipe(gulp.dest(codeMirror.path.dist))
.pipe(header(headerMiniComment, {pkg : pkg, fileName : function(file) {
var name = file.path.split(file.base + "\\");
return (name[1]?name[1]:name[0]).replace(/\\/g, "");
}}))
.pipe(gulp.dest(codeMirror.path.dist))
.pipe(notify({ message: "codemirror-addon.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("scss/editormd.scss", ["scss"]);
gulp.watch("scss/editormd.preview.scss", ["scss", "scss2"]);
gulp.watch("scss/editormd.logo.scss", ["scss", "scss3"]);
gulp.watch("src/editormd.js", ["js", "amd"]);
});
gulp.task("default", function() {
gulp.run("scss");
gulp.run("scss2");
gulp.run("scss3");
gulp.run("js");
gulp.run("amd");
gulp.run("cm-addon");
gulp.run("cm-mode");
});
"use strict";
var os = require("os");
var gulp = require("gulp");
var gutil = require("gulp-util");
var sass = require("gulp-ruby-sass");
var jshint = require("gulp-jshint");
var uglify = require("gulp-uglifyjs");
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 jsdoc = require("gulp-jsdoc");
//var jsdoc2md = require("gulp-jsdoc-to-markdown");
var pkg = require("./package.json");
var dateFormat = require("dateformatter").format;
var replace = require("gulp-replace");
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 || "scss/";
var distPath = "css";
return sass(path + fileName + ".scss", { style: "expanded", sourcemap: false, noCache : true })
.pipe(gulp.dest(distPath))
.pipe(header(headerComment, {pkg : pkg, fileName : function(file) {
var name = file.path.split(file.base);
return name[1].replace("\\", "");
}}))
.pipe(gulp.dest(distPath))
.pipe(rename({ suffix: ".min" }))
.pipe(gulp.dest(distPath))
.pipe(minifycss())
.pipe(gulp.dest(distPath))
.pipe(header(headerMiniComment, {pkg : pkg, fileName : function(file) {
var name = file.path.split(file.base);
return name[1].replace("\\", "");
}}))
.pipe(gulp.dest(distPath))
.pipe(notify({ message: fileName + ".scss task completed!" }));
};
gulp.task("scss", function() {
return scssTask("editormd");
});
gulp.task("scss2", function() {
return scssTask("editormd.preview");
});
gulp.task("scss3", function() {
return scssTask("editormd.logo");
});
gulp.task("js", function() {
return gulp.src("./src/editormd.js")
.pipe(jshint("./.jshintrc"))
.pipe(jshint.reporter("default"))
.pipe(header(headerComment, {pkg : pkg, fileName : function(file) {
var name = file.path.split(file.base);
return name[1].replace(/[\\\/]?/, "");
}}))
.pipe(gulp.dest("./"))
.pipe(rename({ suffix: ".min" }))
.pipe(uglify()) // {outSourceMap: true, sourceRoot: './'}
.pipe(gulp.dest("./"))
.pipe(header(headerMiniComment, {pkg : pkg, fileName : function(file) {
var name = file.path.split(file.base + ( (os.platform() === "win32") ? "\\" : "/") );
return name[1].replace(/[\\\/]?/, "");
}}))
.pipe(gulp.dest("./"))
.pipe(notify({ message: "editormd.js task complete" }));
});
gulp.task("amd", function() {
var replaceText1 = [
'var cmModePath = "codemirror/mode/";',
' var cmAddonPath = "codemirror/addon/";',
'',
' var codeMirrorModules = [',
' "jquery", "marked", "prettify",',
' "katex", "raphael", "underscore", "flowchart", "jqueryflowchart", "sequenceDiagram",',
'',
' "codemirror/lib/codemirror",',
' cmModePath + "css/css",',
' cmModePath + "sass/sass",',
' cmModePath + "shell/shell",',
' cmModePath + "sql/sql",',
' cmModePath + "clike/clike",',
' cmModePath + "php/php",',
' cmModePath + "xml/xml",',
' cmModePath + "markdown/markdown",',
' cmModePath + "javascript/javascript",',
' cmModePath + "htmlmixed/htmlmixed",',
' cmModePath + "gfm/gfm",',
' cmModePath + "http/http",',
' cmModePath + "go/go",',
' cmModePath + "dart/dart",',
' cmModePath + "coffeescript/coffeescript",',
' cmModePath + "nginx/nginx",',
' cmModePath + "python/python",',
' cmModePath + "perl/perl",',
' cmModePath + "lua/lua",',
' cmModePath + "r/r", ',
' cmModePath + "ruby/ruby", ',
' cmModePath + "rst/rst",',
' cmModePath + "smartymixed/smartymixed",',
' cmModePath + "vb/vb",',
' cmModePath + "vbscript/vbscript",',
' cmModePath + "velocity/velocity",',
' cmModePath + "xquery/xquery",',
' cmModePath + "yaml/yaml",',
' cmModePath + "erlang/erlang",',
' cmModePath + "jade/jade",',
'',
' cmAddonPath + "edit/trailingspace", ',
' cmAddonPath + "dialog/dialog", ',
' cmAddonPath + "search/searchcursor", ',
' cmAddonPath + "search/search", ',
' cmAddonPath + "scroll/annotatescrollbar", ',
' cmAddonPath + "search/matchesonscrollbar", ',
' cmAddonPath + "display/placeholder", ',
' cmAddonPath + "edit/closetag", ',
' cmAddonPath + "fold/foldcode",',
' cmAddonPath + "fold/foldgutter",',
' cmAddonPath + "fold/indent-fold",',
' cmAddonPath + "fold/brace-fold",',
' cmAddonPath + "fold/xml-fold", ',
' cmAddonPath + "fold/markdown-fold",',
' cmAddonPath + "fold/comment-fold", ',
' cmAddonPath + "mode/overlay", ',
' cmAddonPath + "selection/active-line", ',
' cmAddonPath + "edit/closebrackets", ',
' cmAddonPath + "display/fullscreen",',
' cmAddonPath + "search/match-highlighter"',
' ];',
'',
' define(codeMirrorModules, factory);'
].join("\r\n");
var replaceText2 = [
"if (typeof define == \"function\" && define.amd) {",
" $ = arguments[0];",
" marked = arguments[1];",
" prettify = arguments[2];",
" katex = arguments[3];",
" Raphael = arguments[4];",
" _ = arguments[5];",
" flowchart = arguments[6];",
" CodeMirror = arguments[9];",
" }"
].join("\r\n");
gulp.src("src/editormd.js")
.pipe(rename({ suffix: ".amd" }))
.pipe(gulp.dest('./'))
.pipe(header(headerComment, {pkg : pkg, fileName : function(file) {
var name = file.path.split(file.base);
return name[1].replace(/[\\\/]?/, "");
}}))
.pipe(gulp.dest("./"))
.pipe(replace("/* Require.js define replace */", replaceText1))
.pipe(gulp.dest('./'))
.pipe(replace("/* Require.js assignment replace */", replaceText2))
.pipe(gulp.dest('./'))
.pipe(rename({ suffix: ".min" }))
.pipe(uglify()) //{outSourceMap: true, sourceRoot: './'}
.pipe(gulp.dest("./"))
.pipe(header(headerMiniComment, {pkg : pkg, fileName : function(file) {
var name = file.path.split(file.base + ( (os.platform() === "win32") ? "\\" : "/") );
return name[1].replace(/[\\\/]?/, "");
}}))
.pipe(gulp.dest("./"))
.pipe(notify({ message: "amd version task complete"}));
});
var codeMirror = {
path : {
src : {
mode : "lib/codemirror/mode",
addon : "lib/codemirror/addon"
},
dist : "lib/codemirror"
},
modes : [
"css",
"sass",
"shell",
"sql",
"clike",
"php",
"xml",
"markdown",
"javascript",
"htmlmixed",
"gfm",
"http",
"go",
"dart",
"coffeescript",
"nginx",
"python",
"perl",
"lua",
"r",
"ruby",
"rst",
"smartymixed",
"vb",
"vbscript",
"velocity",
"xquery",
"yaml",
"erlang",
"jade",
],
addons : [
"edit/trailingspace",
"dialog/dialog",
"search/searchcursor",
"search/search",
"scroll/annotatescrollbar",
"search/matchesonscrollbar",
"display/placeholder",
"edit/closetag",
"fold/foldcode",
"fold/foldgutter",
"fold/indent-fold",
"fold/brace-fold",
"fold/xml-fold",
"fold/markdown-fold",
"fold/comment-fold",
"mode/overlay",
"selection/active-line",
"edit/closebrackets",
"display/fullscreen",
"search/match-highlighter"
]
};
gulp.task("cm-mode", function() {
var modes = [
codeMirror.path.src.mode + "/meta.js"
];
for(var i in codeMirror.modes) {
var mode = codeMirror.modes[i];
modes.push(codeMirror.path.src.mode + "/" + mode + "/" + mode + ".js");
}
return gulp.src(modes)
.pipe(concat("modes.min.js"))
.pipe(gulp.dest(codeMirror.path.dist))
.pipe(uglify()) // {outSourceMap: true, sourceRoot: codeMirror.path.dist}
.pipe(gulp.dest(codeMirror.path.dist))
.pipe(header(headerMiniComment, {pkg : pkg, fileName : function(file) {
var name = file.path.split(file.base + "\\");
return (name[1]?name[1]:name[0]).replace(/\\/g, "");
}}))
.pipe(gulp.dest(codeMirror.path.dist))
.pipe(notify({ message: "codemirror-mode task complete!" }));
});
gulp.task("cm-addon", function() {
var addons = [];
for(var i in codeMirror.addons) {
var addon = codeMirror.addons[i];
addons.push(codeMirror.path.src.addon + "/" + addon + ".js");
}
return gulp.src(addons)
.pipe(concat("addons.min.js"))
.pipe(gulp.dest(codeMirror.path.dist))
.pipe(uglify()) //{outSourceMap: true, sourceRoot: codeMirror.path.dist}
.pipe(gulp.dest(codeMirror.path.dist))
.pipe(header(headerMiniComment, {pkg : pkg, fileName : function(file) {
var name = file.path.split(file.base + "\\");
return (name[1]?name[1]:name[0]).replace(/\\/g, "");
}}))
.pipe(gulp.dest(codeMirror.path.dist))
.pipe(notify({ message: "codemirror-addon.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("scss/*.scss", ["scss"]);
gulp.watch("scss/editormd.preview.scss", ["scss", "scss2"]);
gulp.watch("scss/editormd.logo.scss", ["scss", "scss3"]);
gulp.watch("src/editormd.js", ["js", "amd"]);
});
gulp.task("default", function() {
gulp.run("scss");
gulp.run("scss2");
gulp.run("scss3");
gulp.run("js");
gulp.run("amd");
gulp.run("cm-addon");
gulp.run("cm-mode");
});

50
css/editormd.css

@ -4340,7 +4340,7 @@ li.L3,
li.L5,
li.L7,
li.L9 {
background: #eee;
background: #fff;
}
.editormd-preview-container pre.prettyprint, .editormd-html-preview pre.prettyprint {
@ -4348,15 +4348,41 @@ li.L9 {
border: 1px solid #ddd;
white-space: pre-wrap;
word-wrap: break-word;
background: #fff;
-webkit-transition: border-color 0.3s ease, background-color 0.3s ease;
/* Safari, Chrome */
-moz-transition: border-color 0.3s ease, background-color 0.3s ease;
/* Firefox 4.0~16.0 */
transition: border-color 0.3s ease, background-color 0.3s ease;
/* IE >9, FF >15, Opera >12.0 */
}
.editormd-preview-container pre.prettyprint li, .editormd-html-preview pre.prettyprint li {
border-left: 1px solid #ddd;
padding-left: 0.8em;
-webkit-transition: background-color 0.3s ease;
/* Safari, Chrome */
-moz-transition: background-color 0.3s ease;
/* Firefox 4.0~16.0 */
transition: background-color 0.3s ease;
/* IE >9, FF >15, Opera >12.0 */
}
.editormd-preview-container pre.prettyprint li:hover, .editormd-html-preview pre.prettyprint li:hover {
background-color: #fafafa;
}
.editormd-preview-container ol.linenums, .editormd-html-preview ol.linenums {
.editormd-preview-container pre.prettyprint li + li, .editormd-html-preview pre.prettyprint li + li {
margin-top: 0;
}
.editormd-preview-container pre.prettyprint:hover, .editormd-html-preview pre.prettyprint:hover {
border: 1px solid #d5d5d5;
}
.editormd-preview-container pre.prettyprint ol.linenums, .editormd-html-preview pre.prettyprint ol.linenums {
color: #999;
padding-left: 2.5em;
padding-left: 2.7em;
}
.editormd-preview-container ol.linenums li, .editormd-html-preview ol.linenums li {
.editormd-preview-container pre.prettyprint ol.linenums li, .editormd-html-preview pre.prettyprint ol.linenums li {
list-style-type: decimal;
}
.editormd-preview-container ol.linenums li code, .editormd-html-preview ol.linenums li code {
.editormd-preview-container pre.prettyprint ol.linenums li code, .editormd-html-preview pre.prettyprint ol.linenums li code {
border: none;
background: none;
padding: 0;
@ -4633,6 +4659,20 @@ hr.editormd-page-break {
.editormd-preview-theme-dark pre .pln {
color: #999;
}
.editormd-preview-theme-dark pre.prettyprint {
border: none;
background-color: #111;
}
.editormd-preview-theme-dark pre.prettyprint li {
border-left: 1px solid #222;
}
.editormd-preview-theme-dark pre.prettyprint:hover {
border: none;
background-color: #000;
}
.editormd-preview-theme-dark pre.prettyprint:hover li:hover {
background-color: rgba(255, 255, 255, 0.1);
}
.editormd-preview-theme-dark li.L1, .editormd-preview-theme-dark li.L3, .editormd-preview-theme-dark li.L5, .editormd-preview-theme-dark li.L7, .editormd-preview-theme-dark li.L9 {
background: none;
}

2
css/editormd.min.css

File diff suppressed because one or more lines are too long

36
css/editormd.preview.css

@ -3622,7 +3622,7 @@ li.L3,
li.L5,
li.L7,
li.L9 {
background: #eee;
background: #fff;
}
.editormd-preview-container pre.prettyprint, .editormd-html-preview pre.prettyprint {
@ -3630,15 +3630,41 @@ li.L9 {
border: 1px solid #ddd;
white-space: pre-wrap;
word-wrap: break-word;
background: #fff;
-webkit-transition: border-color 0.3s ease, background-color 0.3s ease;
/* Safari, Chrome */
-moz-transition: border-color 0.3s ease, background-color 0.3s ease;
/* Firefox 4.0~16.0 */
transition: border-color 0.3s ease, background-color 0.3s ease;
/* IE >9, FF >15, Opera >12.0 */
}
.editormd-preview-container pre.prettyprint li, .editormd-html-preview pre.prettyprint li {
border-left: 1px solid #ddd;
padding-left: 0.8em;
-webkit-transition: background-color 0.3s ease;
/* Safari, Chrome */
-moz-transition: background-color 0.3s ease;
/* Firefox 4.0~16.0 */
transition: background-color 0.3s ease;
/* IE >9, FF >15, Opera >12.0 */
}
.editormd-preview-container pre.prettyprint li:hover, .editormd-html-preview pre.prettyprint li:hover {
background-color: #fafafa;
}
.editormd-preview-container pre.prettyprint li + li, .editormd-html-preview pre.prettyprint li + li {
margin-top: 0;
}
.editormd-preview-container pre.prettyprint:hover, .editormd-html-preview pre.prettyprint:hover {
border: 1px solid #d5d5d5;
}
.editormd-preview-container ol.linenums, .editormd-html-preview ol.linenums {
.editormd-preview-container pre.prettyprint ol.linenums, .editormd-html-preview pre.prettyprint ol.linenums {
color: #999;
padding-left: 2.5em;
padding-left: 2.7em;
}
.editormd-preview-container ol.linenums li, .editormd-html-preview ol.linenums li {
.editormd-preview-container pre.prettyprint ol.linenums li, .editormd-html-preview pre.prettyprint ol.linenums li {
list-style-type: decimal;
}
.editormd-preview-container ol.linenums li code, .editormd-html-preview ol.linenums li code {
.editormd-preview-container pre.prettyprint ol.linenums li code, .editormd-html-preview pre.prettyprint ol.linenums li code {
border: none;
background: none;
padding: 0;

2
css/editormd.preview.min.css

File diff suppressed because one or more lines are too long

666
scss/editormd.preview.scss

@ -1,322 +1,344 @@
@charset "UTF-8";
@import "lib/variables";
@import "lib/prefixes";
@import "font-awesome";
@import "editormd.logo";
// github-markdown.css
@import "github-markdown";
#{$prefix}preview-container, #{$prefix}html-preview {
text-align: left;
font-size: 14px;
line-height: 1.6;
padding: 20px;
overflow: auto;
width: 100%;
background-color: #fff;
blockquote {
color: $color;
border-left: 4px solid $borderColor;
padding-left: 20px;
margin-left: 0;
font-size: 14px;
font-style: italic;
}
p code {
margin-left: 5px;
margin-right: 4px;
}
abbr {
background: #ffffdd;
}
hr {
height: 1px;
border: none;
border-top: 1px solid $borderColor;
background: none;
}
code {
border: 1px solid $borderColor;
background: #f6f6f6;
padding: 3px;
border-radius: 3px;
font-size: 14px;
}
pre {
border: 1px solid $borderColor;
background: #f6f6f6;
padding: 10px;
@include border-radius(3px);
code {
padding: 0;
}
}
pre, code, kbd {
font-family: "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace;
}
table thead tr {
background-color: #F8F8F8;
}
.markdown-toc {
}
.markdown-toc-list {
}
p#{$prefix}tex {
text-align: center;
}
span#{$prefix}tex {
margin: 0 5px;
}
.emoji {
width: 24px;
height: 24px;
}
.katex {
font-size: 1.4em;
}
.sequence-diagram, .flowchart {
margin: 0 auto;
text-align: center;
svg {
margin: 0 auto;
}
text {
font-size : 15px !important;
font-family: "YaHei Consolas Hybrid", Consolas, "Microsoft YaHei", "Malgun Gothic", "Segoe UI", Helvetica, Arial !important;
}
}
}
//Pretty printing styles. Used with prettify.js.
@import "prettify";
#{$prefix}preview-container, #{$prefix}html-preview {
pre.prettyprint {
padding: 10px;
border: 1px solid $borderColor;
white-space: pre-wrap;
word-wrap: break-word;
}
ol.linenums {
color: #999;
padding-left: 2.5em;
li {
list-style-type: decimal;
code {
border: none;
background:none;
padding: 0;
}
}
}
}
#{$prefix}preview-container, #{$prefix}html-preview {
#{$prefix}toc-menu {
margin: 8px 0 12px 0;
display: inline-block;
> .markdown-toc {
position: relative;
@include border-radius(4px);
border: 1px solid #ddd;
display: inline-block;
font-size: 1em;
> ul {
width : 160%;
min-width: 180px;
position: absolute;
left: -1px;
top: -2px;
z-index: 100;
padding: 0 10px 10px;
display: none;
background: #fff;
border: 1px solid #ddd;
@include border-radius(4px);
@include box-shadow(0 3px 5px rgba(0, 0, 0, 0.2));
> li ul {
width: 100%;
min-width: 180px;
border: 1px solid #ddd;
display: none;
background: #fff;
@include border-radius(4px);
}
> li a {
color: #666;
padding: 6px 10px;
display: block;
@include transition(background-color 500ms ease-out);
&:hover {
background-color: #f6f6f6;
}
}
}
li {
position: relative;
> ul {
position: absolute;
top: 32px;
left: 10%;
display: none;
@include box-shadow(0 3px 5px rgba(0, 0, 0, 0.2));
&:before, &:after {
pointer-events: pointer-events;
position: absolute;
left: 15px;
top: -6px;
display: block;
content: "";
width: 0;
height: 0;
border: 6px solid transparent;
border-width: 0 6px 6px;
z-index: 10;
}
&:before {
border-bottom-color: #ccc;
}
&:after {
border-bottom-color: #ffffff;
top: -5px;
}
}
}
}
ul {
list-style: none;
}
a {
text-decoration: none;
}
h1 {
font-size: 16px;
padding: 5px 0 10px 10px;
line-height: 1;
border-bottom: 1px solid #eee;
.fa {
padding-left: 10px;
}
}
.toc-menu-btn {
color: #666;
min-width: 180px;
padding: 5px 10px;
border-radius: 4px;
display: inline-block;
@include transition(background-color 500ms ease-out);
&:hover {
background-color: #f6f6f6;
}
.fa {
float: right;
padding: 3px 0 0 10px;
font-size: 1.3em;
}
}
}
}
.markdown-body {
#{$prefix}toc-menu {
ul {
padding-left: 0;
}
}
.highlight pre, pre {
line-height: 1.6;
}
}
hr.editormd-page-break {
border: 1px dotted #ccc;
font-size: 0;
height: 2px;
}
@media only print {
hr.editormd-page-break {
background: none;
border: none;
height: 0;
}
}
#{$prefix}html-preview {
textarea {
display : none;
}
hr.editormd-page-break {
background: none;
border: none;
height: 0;
}
}
#{$prefix}preview-close-btn {
color: #fff;
padding: 4px 6px;
font-size: 18px;
@include border-radius(500px);
display: none;
background-color: #ccc;
position: absolute;
top: 25px;
right: 35px;
z-index: 19;
@include transition(background-color 300ms ease-out);
&:hover {
background-color: #999;
}
}
.editormd-preview-active {
width: 100%;
padding: 40px;
}
@charset "UTF-8";
@import "lib/variables";
@import "lib/prefixes";
@import "font-awesome";
@import "editormd.logo";
// github-markdown.css
@import "github-markdown";
#{$prefix}preview-container, #{$prefix}html-preview {
text-align: left;
font-size: 14px;
line-height: 1.6;
padding: 20px;
overflow: auto;
width: 100%;
background-color: #fff;
blockquote {
color: $color;
border-left: 4px solid $borderColor;
padding-left: 20px;
margin-left: 0;
font-size: 14px;
font-style: italic;
}
p code {
margin-left: 5px;
margin-right: 4px;
}
abbr {
background: #ffffdd;
}
hr {
height: 1px;
border: none;
border-top: 1px solid $borderColor;
background: none;
}
code {
border: 1px solid $borderColor;
background: #f6f6f6;
padding: 3px;
border-radius: 3px;
font-size: 14px;
}
pre {
border: 1px solid $borderColor;
background: #f6f6f6;
padding: 10px;
@include border-radius(3px);
code {
padding: 0;
}
}
pre, code, kbd {
font-family: "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace;
}
table thead tr {
background-color: #F8F8F8;
}
.markdown-toc {
}
.markdown-toc-list {
}
p#{$prefix}tex {
text-align: center;
}
span#{$prefix}tex {
margin: 0 5px;
}
.emoji {
width: 24px;
height: 24px;
}
.katex {
font-size: 1.4em;
}
.sequence-diagram, .flowchart {
margin: 0 auto;
text-align: center;
svg {
margin: 0 auto;
}
text {
font-size : 15px !important;
font-family: "YaHei Consolas Hybrid", Consolas, "Microsoft YaHei", "Malgun Gothic", "Segoe UI", Helvetica, Arial !important;
}
}
}
//Pretty printing styles. Used with prettify.js.
@import "prettify";
#{$prefix}preview-container, #{$prefix}html-preview {
pre {
&.prettyprint {
padding: 10px;
border: 1px solid $borderColor;
white-space: pre-wrap;
word-wrap: break-word;
background: #fff;
@include transition(border-color .3s ease, background-color .3s ease);
li {
border-left: 1px solid #ddd;
padding-left: 0.8em;
@include transition(background-color .3s ease);
&:hover {
background-color: #fafafa;
}
}
li + li {
margin-top: 0;
}
&:hover {
border: 1px solid darken($borderColor, 3%);
}
ol.linenums {
color: #999;
padding-left: 2.7em;
li {
list-style-type: decimal;
code {
border: none;
background:none;
padding: 0;
}
}
}
}
}
}
#{$prefix}preview-container, #{$prefix}html-preview {
#{$prefix}toc-menu {
margin: 8px 0 12px 0;
display: inline-block;
> .markdown-toc {
position: relative;
@include border-radius(4px);
border: 1px solid #ddd;
display: inline-block;
font-size: 1em;
> ul {
width : 160%;
min-width: 180px;
position: absolute;
left: -1px;
top: -2px;
z-index: 100;
padding: 0 10px 10px;
display: none;
background: #fff;
border: 1px solid #ddd;
@include border-radius(4px);
@include box-shadow(0 3px 5px rgba(0, 0, 0, 0.2));
> li ul {
width: 100%;
min-width: 180px;
border: 1px solid #ddd;
display: none;
background: #fff;
@include border-radius(4px);
}
> li a {
color: #666;
padding: 6px 10px;
display: block;
@include transition(background-color 500ms ease-out);
&:hover {
background-color: #f6f6f6;
}
}
}
li {
position: relative;
> ul {
position: absolute;
top: 32px;
left: 10%;
display: none;
@include box-shadow(0 3px 5px rgba(0, 0, 0, 0.2));
&:before, &:after {
pointer-events: pointer-events;
position: absolute;
left: 15px;
top: -6px;
display: block;
content: "";
width: 0;
height: 0;
border: 6px solid transparent;
border-width: 0 6px 6px;
z-index: 10;
}
&:before {
border-bottom-color: #ccc;
}
&:after {
border-bottom-color: #ffffff;
top: -5px;
}
}
}
}
ul {
list-style: none;
}
a {
text-decoration: none;
}
h1 {
font-size: 16px;
padding: 5px 0 10px 10px;
line-height: 1;
border-bottom: 1px solid #eee;
.fa {
padding-left: 10px;
}
}
.toc-menu-btn {
color: #666;
min-width: 180px;
padding: 5px 10px;
border-radius: 4px;
display: inline-block;
@include transition(background-color 500ms ease-out);
&:hover {
background-color: #f6f6f6;
}
.fa {
float: right;
padding: 3px 0 0 10px;
font-size: 1.3em;
}
}
}
}
.markdown-body {
#{$prefix}toc-menu {
ul {
padding-left: 0;
}
}
.highlight pre, pre {
line-height: 1.6;
}
}
hr.editormd-page-break {
border: 1px dotted #ccc;
font-size: 0;
height: 2px;
}
@media only print {
hr.editormd-page-break {
background: none;
border: none;
height: 0;
}
}
#{$prefix}html-preview {
textarea {
display : none;
}
hr.editormd-page-break {
background: none;
border: none;
height: 0;
}
}
#{$prefix}preview-close-btn {
color: #fff;
padding: 4px 6px;
font-size: 18px;
@include border-radius(500px);
display: none;
background-color: #ccc;
position: absolute;
top: 25px;
right: 35px;
z-index: 19;
@include transition(background-color 300ms ease-out);
&:hover {
background-color: #999;
}
}
.editormd-preview-active {
width: 100%;
padding: 40px;
}

282
scss/editormd.preview.themes.scss

@ -1,131 +1,151 @@
/* Preview dark theme */
#{$prefix}preview-theme-dark {
color: #777;
background:#2C2827;
#{$prefix}preview-container {
color: #888;
background-color: #2C2827;
//font-family: "Meiryo UI", "Helvetica Neue", "Microsoft YaHei";
pre.prettyprint {
border: none;
}
blockquote {
color: #555;
padding: 0.5em;
background: #222;
border-color: #333;
}
abbr {
color: #fff;
padding: 1px 3px;
@include border-radius(3px);
background:#ff9900;
}
code {
color: #fff;
border: none;
padding: 1px 3px;
@include border-radius(3px);
background: #5A9600;
}
table {
border: none;
}
.fa-emoji {
color: #B4BF42;
}
.katex {
color: #FEC93F;
}
}
.editormd-toc-menu {
> .markdown-toc {
background:#fff;
border:none;
h1 {
border-color:#ddd;
}
}
}
.markdown-body {
h1, h2, hr {
border-color: #222;
}
}
pre {
color: #999;
background-color: #111;
background-color: rgba(0,0,0,.4);
/* plain text */
.pln {
color: #999;
}
}
li.L1, li.L3, li.L5, li.L7, li.L9 {
background: none;
}
[class*=editormd-logo] {
color: #2196F3;
}
.sequence-diagram {
text {
fill: #fff;
}
rect, path {
color:#fff;
fill : #64D1CB;
stroke : #64D1CB;
}
}
.flowchart {
rect, path {
stroke : #A6C6FF;
}
rect {
fill: #A6C6FF;
}
text {
fill: #5879B4;
}
}
}
@media screen {
#{$prefix}preview-theme-dark {
.str { color: #080 } /* string content */
.kwd { color: #ff9900; } /* a keyword */
.com { color: #444444; } /* a comment */
.typ { color: #606 } /* a type name */
.lit { color: #066 } /* a literal value */
/* punctuation, lisp open bracket, lisp close bracket */
.pun, .opn, .clo { color: #660 }
.tag { color: #ff9900; } /* a markup tag name */
.atn { color: #6C95F5; } /* a markup attribute name */
.atv { color: #080 } /* a markup attribute value */
.dec, .var { color: #008BA7; } /* a declaration; a variable name */
.fun { color: red } /* a function name */
}
}
/* Preview dark theme */
#{$prefix}preview-theme-dark {
color: #777;
background:#2C2827;
#{$prefix}preview-container {
color: #888;
background-color: #2C2827;
//font-family: "Meiryo UI", "Helvetica Neue", "Microsoft YaHei";
pre.prettyprint {
border: none;
}
blockquote {
color: #555;
padding: 0.5em;
background: #222;
border-color: #333;
}
abbr {
color: #fff;
padding: 1px 3px;
@include border-radius(3px);
background:#ff9900;
}
code {
color: #fff;
border: none;
padding: 1px 3px;
@include border-radius(3px);
background: #5A9600;
}
table {
border: none;
}
.fa-emoji {
color: #B4BF42;
}
.katex {
color: #FEC93F;
}
}
.editormd-toc-menu {
> .markdown-toc {
background:#fff;
border:none;
h1 {
border-color:#ddd;
}
}
}
.markdown-body {
h1, h2, hr {
border-color: #222;
}
}
pre {
color: #999;
background-color: #111;
background-color: rgba(0,0,0,.4);
/* plain text */
.pln {
color: #999;
}
&.prettyprint {
border: none;
background-color: #111;
li {
border-left: 1px solid #222;
}
&:hover {
border: none;
background-color: #000;
li {
&:hover {
background-color: rgba(#fff, .1);
}
}
}
}
}
li.L1, li.L3, li.L5, li.L7, li.L9 {
background: none;
}
[class*=editormd-logo] {
color: #2196F3;
}
.sequence-diagram {
text {
fill: #fff;
}
rect, path {
color:#fff;
fill : #64D1CB;
stroke : #64D1CB;
}
}
.flowchart {
rect, path {
stroke : #A6C6FF;
}
rect {
fill: #A6C6FF;
}
text {
fill: #5879B4;
}
}
}
@media screen {
#{$prefix}preview-theme-dark {
.str { color: #080 } /* string content */
.kwd { color: #ff9900; } /* a keyword */
.com { color: #444444; } /* a comment */
.typ { color: #606 } /* a type name */
.lit { color: #066 } /* a literal value */
/* punctuation, lisp open bracket, lisp close bracket */
.pun, .opn, .clo { color: #660 }
.tag { color: #ff9900; } /* a markup tag name */
.atn { color: #6C95F5; } /* a markup attribute name */
.atv { color: #080 } /* a markup attribute value */
.dec, .var { color: #008BA7; } /* a declaration; a variable name */
.fun { color: red } /* a function name */
}
}

56
scss/editormd.themes.scss

@ -1,28 +1,28 @@
/* Editor.md Dark theme */
#{$prefix}theme-dark {
border-color: #1a1a17;
#{$prefix}toolbar {
background: #1A1A17;
border-color: #1a1a17;
}
#{$prefix}menu > li > a {
color: #777;
border-color: #1a1a17;
&:hover, &.active {
border-color: #333;
background: #333;
}
}
#{$prefix}menu > li.divider {
border-right: 1px solid #111;
}
.CodeMirror {
border-right: 1px solid rgba(0,0,0,0.1);
}
}
/* Editor.md Dark theme */
#{$prefix}theme-dark {
border-color: #1a1a17;
#{$prefix}toolbar {
background: #1A1A17;
border-color: #1a1a17;
}
#{$prefix}menu > li > a {
color: #777;
border-color: #1a1a17;
&:hover, &.active {
border-color: #333;
background: #333;
}
}
#{$prefix}menu > li.divider {
border-right: 1px solid #111;
}
.CodeMirror {
border-right: 1px solid rgba(0,0,0,0.1);
}
}

2
scss/prettify.scss

@ -50,4 +50,4 @@ li.L1,
li.L3,
li.L5,
li.L7,
li.L9 { background: #eee }
li.L9 { background: #fff }

Loading…
Cancel
Save