jack-zh / zwiki

A simple wiki written in Flask.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

更改zwiki的markdown显示样式

bjyitu opened this issue · comments

不改变原始的markdown解析,在显示的时候把html显示的样式改掉。

在static目录下新建一个css样式文件,如:md.css(来自mou)

h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote {
    margin: 0;
    padding: 0;

}
body {
    font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", Arial, sans-serif;
    font-size: 13px;
    line-height: 18px;
    color: #737373;
    margin: 10px 13px 10px 13px;

}
a {
    color: #0069d6;

}
a:hover {
    color: #0050a3;
    text-decoration: none;

}
a img {
    border: none;

}
p {
    margin-bottom: 9px;

}
h1,
h2,
h3,
h4,
h5,
h6 {
    color: #404040;
    line-height: 36px;

}
h1 {
    margin-bottom: 18px;
    font-size: 30px;

}
h2 {
    font-size: 24px;

}
h3 {
    font-size: 18px;

}
h4 {
    font-size: 16px;

}
h5 {
    font-size: 14px;

}
h6 {
    font-size: 13px;

}
hr {
    margin: 0 0 19px;
    border: 0;
    border-bottom: 1px solid #ccc;

}
blockquote {
    padding: 13px 13px 21px 15px;
    margin-bottom: 18px;
    font-family:georgia,serif;
    font-style: italic;

}
blockquote:before {
    content:"\201C";
    font-size:40px;
    margin-left:-10px;
    font-family:georgia,serif;
    color:#eee;

}
blockquote p {
    font-size: 14px;
    font-weight: 300;
    line-height: 18px;
    margin-bottom: 0;
    font-style: italic;

}
code, pre {
    font-family: Monaco, Andale Mono, Courier New, monospace;

}
code {
    background-color: #fee9cc;
    color: rgba(0, 0, 0, 0.75);
    padding: 1px 3px;
    font-size: 12px;
    -webkit-border-radius: 3px;
    -moz-border-radius: 3px;
    border-radius: 3px;

}
pre {
    display: block;
    padding: 14px;
    margin: 0 0 18px;
    line-height: 16px;
    font-size: 11px;
    border: 1px solid #d9d9d9;
    white-space: pre-wrap;
    word-wrap: break-word;

}
pre code {
    background-color: #fff;
    color:#737373;
    font-size: 11px;
    padding: 0;

}
table {
    font-size:inherit;
    font:100%;
    margin:1em;

}
table th{border-bottom:1px solid #bbb;padding:.2em 1em;}
table td{border-bottom:1px solid #ddd;padding:.2em 1em;}
table .titleth{border:0px;padding:1em 1em;font-size:14px;}
table .urlth{border-left:1px solid #bbb;border-right:0px;border-bottom:0px;padding:1em 1em;font-size:14px;}

在主模版文件base.html里添加CSS引用,添加md.css的链接

<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='md.css')        }}">

我试用了一下您的CSS,再样式没有太大的改观。

现在的CSS完全来自bootstrap,现阶段没打算进行大的改变。

另,我是准备后期加上布局CSS插件的。

感谢你的反馈。如果在您的应用中需要更改,请自行fork改动。

如果有兴趣,真诚的邀请您加入一起改进这个小项目,因为我对CSS前端也挺头疼的,希望得到您的帮助

谢谢