Pandao
10 years ago
26 changed files with 500 additions and 353 deletions
@ -1,5 +1,28 @@ |
|||
####更新日志 |
|||
|
|||
#####v1.0.0 |
|||
#####v1.0.0 beta |
|||
|
|||
基本功能完成; |
|||
基本功能完成; |
|||
|
|||
#####v1.0.0 releases |
|||
|
|||
主要更新: |
|||
|
|||
- 新建分支 `mathjax-version`,但不打算继续对此分支进行开发; |
|||
- 移除MathJax,改用Katex,解析和预览响应速度大幅度提高; |
|||
- 移除 `mathjax` 配置项; |
|||
- 移除 `mathjaxURL` 属性; |
|||
- 移除 `setMathJaxConfig()` 方法; |
|||
- 移除 `loadMathJax()` 方法; |
|||
- 移除MathJax的所有示例; |
|||
- 新增 `tex` 配置项,表示是否开启支持科学公式TeX; |
|||
- 新增 `katexURL` 属性; |
|||
- 新增 `loadKaTex` 方法; |
|||
- 新增KaTeX的示例; |
|||
- `setCodeEditor()`方法更名为`setCodeMirror()`; |
|||
- 合并CodeMirror使用到的多个JS模块文件,大幅减少HTTP请求,加快下载速度; |
|||
- 新增合并后的两个模块文件:`./lib/codemirror/modes.min.js`、`./lib/codemirror/addons.min.js`; |
|||
- `Gulpfile.js` 新增合并CodeMirror模块文件的任务方法`codemirror-mode`和`codemirror-addon`; |
|||
- 另外在使用Require.js时,因为CodeMirror的严格模块依赖,不使用上述合并的模块文件; |
|||
- 更新 `README.md` 等相关文档和示例; |
|||
- 解决Sea.js环境下Raphael.js无法运行的问题,即必须先加载Raphael.js,后加载Sea.js; |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,47 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh"> |
|||
<head> |
|||
<meta charset="utf-8" /> |
|||
<title>Mathjax - Editor.md examples</title> |
|||
<link rel="stylesheet" href="css/style.css" /> |
|||
</head> |
|||
<body> |
|||
<div id="layout"> |
|||
<header> |
|||
<h1>支持Latex(MathJax)科学公式</h1> |
|||
<p>基于MathJax.js:<a href="http://www.mathjax.org/" target="_blank">http://www.mathjax.org/</a></p> |
|||
<p>注1:默认不开启,影响实时预览的响应速度;</p> |
|||
<p>注2:可以自定义MathJax加载URL,国内可以采用这个CDN,http://cdn.bootcss.com/mathjax/2.4.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML</p> |
|||
</header> |
|||
<div class="editormd" id="test-editormd"> |
|||
<script type="text/markdown">####科学公式 |
|||
|
|||
$$E=mc^2$$ |
|||
|
|||
$$\(\sqrt{3x-1}+(1+x)^2\)$$ |
|||
|
|||
$$\sin(\alpha)^{\theta}=\sum_{i=0}^{n}(x^i + \cos(f))$$</script> |
|||
</div> |
|||
</div> |
|||
|
|||
<script src="../lib/jquery.min.js"></script> |
|||
<link rel="stylesheet" href="../dist/css/editormd.css" /> |
|||
<script src="../src/js/editormd.js"></script> |
|||
<script type="text/javascript"> |
|||
$(function() { |
|||
//自定义MathJax加载URL,适用于国内 |
|||
editormd.mathjaxURL = "http://cdn.bootcss.com/mathjax/2.4.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML"; |
|||
|
|||
//适用于全球/国外 |
|||
//editormd.mathjaxURL = "http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"; |
|||
|
|||
var testEditor = editormd("test-editormd", { |
|||
width: "90%", |
|||
height: 480, |
|||
path : '../lib/', |
|||
mathjax : true |
|||
}); |
|||
}); |
|||
</script> |
|||
</body> |
|||
</html> |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,75 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh"> |
|||
<head> |
|||
<title>CodeMirror Test</title> |
|||
<meta charset="UTF-8"> |
|||
<meta name="description" content="" /> |
|||
<meta name="keywords" content="" /> |
|||
<link rel="stylesheet" href="../examples/css/style.css" /> |
|||
</head> |
|||
<body> |
|||
<div style="text-align: left;"> |
|||
<textarea id="test" style="height: 700px;">###Hello world!</textarea> |
|||
</div> |
|||
<script src="../lib/jquery.min.js"></script> |
|||
<link rel="stylesheet" href="../lib/codemirror/codemirror.min.css" /> |
|||
<script src="../lib/codemirror/codemirror.min.js"></script> |
|||
<script src="../lib/codemirror/modes.min.js"></script> |
|||
<script src="../lib/codemirror/addons.min.js"></script> |
|||
<script type="text/javascript"> |
|||
$(function() { |
|||
|
|||
var codeMirrorConfig = { |
|||
mode: "gfm", |
|||
theme: "default", |
|||
tabSize: 4, |
|||
dragDrop: false, |
|||
autofocus: true, |
|||
indentUnit : 4, |
|||
lineNumbers: true, |
|||
lineWrapping: true, |
|||
matchBrackets: true, |
|||
indentWithTabs: true, |
|||
styleActiveLine: true, |
|||
styleSelectedText: true, |
|||
autoCloseBrackets: true, |
|||
showTrailingSpace: true, |
|||
highlightSelectionMatches: { |
|||
showToken: /\w/ |
|||
} |
|||
}; |
|||
|
|||
$.get("../examples/test.md", function(md){ |
|||
$("#test").html(md); |
|||
var codeMirrorEditor = CodeMirror.fromTextArea($("#test")[0], codeMirrorConfig); |
|||
var codeMirror = $(".CodeMirror"); |
|||
}); |
|||
/* var testEditor; |
|||
|
|||
$.get("./test.md", function(md){ |
|||
testEditor = editormd("test-editormd", { |
|||
width: "90%", |
|||
height: 640, |
|||
path : '../lib/', |
|||
markdown : md, |
|||
//mathjax : true, |
|||
onload : function() { |
|||
this.editor.find(".mathjax-code").each(function(){ |
|||
//console.log($(this)[0]); |
|||
$(this).html($(this).html().replace(/\$\$/g, "")); |
|||
katex.render($(this).html(), $(this)[0]); |
|||
}); |
|||
}, |
|||
onchange : function() { |
|||
this.editor.find(".mathjax-code").each(function(){ |
|||
//console.log($(this)[0]); |
|||
$(this).html($(this).html().replace(/\$\$/g, "")); |
|||
katex.render($(this).html(), $(this)[0]); |
|||
}); |
|||
} |
|||
}); |
|||
});*/ |
|||
}); |
|||
</script> |
|||
</body> |
|||
</html> |
Loading…
Reference in new issue