#133 修改默认主题, 更新markdown解析器

This commit is contained in:
lealife committed 2015-05-07 00:02:54 +08:00
1 parent 1ec28d80c8
commit 1fd6610fa3
9 files changed
+35 -83

No files matched your search

+7 -24
View File
@@ -108,34 +108,17 @@ var commentNum = +"{{$.post.CommentNum}}";
markdown
调用markdown来解析得到html
-->
{{if $.post.IsMarkdown }}
<script src="/public/mdeditor/editor/pagedown/Markdown.Converter.js"></script>
<script src="/public/mdeditor/editor/pagedown/Markdown.Sanitizer.js"></script>
<script src="/public/mdeditor/editor/pagedown/Markdown.Editor.js"></script>
<script src="/public/mdeditor/editor/pagedown/local/Markdown.local.zh.js"></script>
<script src="/public/mdeditor/editor/Markdown.Extra.js"></script>
<!--mathjax-->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ["\\(","\\)"]], processEscapes: true }, messageStyle: "none"});
</script>
<script src="/public/mdeditor/editor/mathJax.js"></script>
<script src="/public/libs/MathJax/MathJax.js?config=TeX-AMS_HTML"></script>
<script src="/public/libs/md2html/md2html.js"></script>
<script>
var content = $.trim($("#markdownContent textarea").val());
var converter = Markdown.getSanitizingConverter();
Markdown.Extra.init(converter, {extensions: ["tables", "fenced_code_gfm", "def_list"]});
var html = converter.makeHtml(content);
$("#content").html(html);
$("pre").addClass("prettyprint linenums");
prettyPrint();
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"wmd-preview"]);
initNav();
weixin();
md2Html(content, $("#content"), function(html) {
$("pre").addClass("prettyprint linenums");
prettyPrint();
initNav();
weixin();
});
</script>
<!-- 不是markdown -->
{{else}}
<script>
+5
View File
@@ -530,3 +530,8 @@ table tr:nth-child(2n) {
border-collapse: collapse;
padding: 6px 13px;
}
.desc *, #content * {
word-wrap: break-word;
}
-2
View File
@@ -9,7 +9,6 @@
请在此解析所有配置
* Name 主题名
* Desc 主题描述, 可以写一些安装或配置信息
* Version 主题版本
* Author 主题的作者
* AuthorUrl 作者的博客链接或相关链接
@@ -19,7 +18,6 @@
*/
{
"Name": "Leanote default theme",
"Desc": "",
"Version": "1.0",
"Author": "leanote.com",
"AuthorUrl": "http://leanote.com",
+8 -26
View File
@@ -107,35 +107,17 @@ var commentNum = +"{{$.post.CommentNum}}";
<!--
markdown
调用markdown来解析得到html
-->
{{if $.post.IsMarkdown }}
<script src="/public/mdeditor/editor/pagedown/Markdown.Converter.js"></script>
<script src="/public/mdeditor/editor/pagedown/Markdown.Sanitizer.js"></script>
<script src="/public/mdeditor/editor/pagedown/Markdown.Editor.js"></script>
<script src="/public/mdeditor/editor/pagedown/local/Markdown.local.zh.js"></script>
<script src="/public/mdeditor/editor/Markdown.Extra.js"></script>
<!--mathjax-->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ["\\(","\\)"]], processEscapes: true }, messageStyle: "none"});
</script>
<script src="/public/mdeditor/editor/mathJax.js"></script>
<script src="/public/libs/MathJax/MathJax.js?config=TeX-AMS_HTML"></script>
-->{{if $.post.IsMarkdown }}
<script src="/public/libs/md2html/md2html.js"></script>
<script>
var content = $.trim($("#markdownContent textarea").val());
var converter = Markdown.getSanitizingConverter();
Markdown.Extra.init(converter, {extensions: ["tables", "fenced_code_gfm", "def_list"]});
var html = converter.makeHtml(content);
$("#content").html(html);
$("pre").addClass("prettyprint linenums");
prettyPrint();
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"wmd-preview"]);
initNav();
weixin();
md2Html(content, $("#content"), function(html) {
$("pre").addClass("prettyprint linenums");
prettyPrint();
initNav();
weixin();
});
</script>
<!-- 不是markdown -->
{{else}}
<script>
+3 -1
View File
@@ -203,7 +203,6 @@ ul.dropdown-menu {
}
#footer {
padding-bottom: 10px;
width: 700px;
}
.navbar-brand {
display: none;
@@ -541,4 +540,7 @@ table tr:nth-child(2n) {
border: 1px solid #ddd;
border-collapse: collapse;
padding: 6px 13px;
}
.desc *, #content * {
word-wrap: break-word;
}
+1 -3
View File
@@ -9,17 +9,15 @@
请在此解析所有配置
* Name 主题名
* Desc 主题描述, 可以写一些安装或配置信息
* Version 主题版本
* Author 主题的作者
* AuthorUrl 作者的博客链接或相关链接
* FriendLinks 友情链接
* FriendLinks 友情链接
*/
{
"Name": "Leanote elegant",
"Desc": "",
"Version": "1.0",
"Author": "leanote.com",
"AuthorUrl": "http://leanote.com",
+7 -24
View File
@@ -108,34 +108,17 @@ var commentNum = +"{{$.post.CommentNum}}";
markdown
调用markdown来解析得到html
-->
{{if $.post.IsMarkdown }}
<script src="/public/mdeditor/editor/pagedown/Markdown.Converter.js"></script>
<script src="/public/mdeditor/editor/pagedown/Markdown.Sanitizer.js"></script>
<script src="/public/mdeditor/editor/pagedown/Markdown.Editor.js"></script>
<script src="/public/mdeditor/editor/pagedown/local/Markdown.local.zh.js"></script>
<script src="/public/mdeditor/editor/Markdown.Extra.js"></script>
<!--mathjax-->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ["\\(","\\)"]], processEscapes: true }, messageStyle: "none"});
</script>
<script src="/public/mdeditor/editor/mathJax.js"></script>
<script src="/public/libs/MathJax/MathJax.js?config=TeX-AMS_HTML"></script>
<script src="/public/libs/md2html/md2html.js"></script>
<script>
var content = $.trim($("#markdownContent textarea").val());
var converter = Markdown.getSanitizingConverter();
Markdown.Extra.init(converter, {extensions: ["tables", "fenced_code_gfm", "def_list"]});
var html = converter.makeHtml(content);
$("#content").html(html);
$("pre").addClass("prettyprint linenums");
prettyPrint();
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"wmd-preview"]);
initNav();
weixin();
md2Html(content, $("#content"), function(html) {
$("pre").addClass("prettyprint linenums");
prettyPrint();
initNav();
weixin();
});
</script>
<!-- 不是markdown -->
{{else}}
<script>
+3
View File
@@ -580,3 +580,6 @@ table tr:nth-child(2n) {
border-collapse: collapse;
padding: 6px 13px;
}
.desc *, #content * {
word-wrap: break-word;
}
+1 -3
View File
@@ -9,17 +9,15 @@
请在此解析所有配置
* Name 主题名
* Desc 主题描述, 可以写一些安装或配置信息
* Version 主题版本
* Author 主题的作者
* AuthorUrl 作者的博客链接或相关链接
* FriendLinks 友情链接
* FriendLinks 友情链接
*/
{
"Name": "Leanote nav fixed",
"Desc": "",
"Version": "1.0",
"Author": "leanote.com",
"AuthorUrl": "http://leanote.com",