基础003. MarkdownHere排版公众号

本文“植物微生物组”公众号原创,ID: plantmicrobiome

作者:刘永鑫

编辑:翟志文

原文链接:基础003. MarkdownHere排版公众号

前面教大家使用云笔记记录笔记,图床的管理和插入图片。

今天教大家使用Markdown Here插件快速排版Markdown笔记在公众号上发布。

准备工作

  1. 需要安装Google Chrome浏览器
  2. 需要有翻墙能力,如Lantern,否则无法安装Chrome商店插件。
  3. 在Chrome商店中安装 Markdown Here插件
  4. 设置Markdown Here插件,将基本CSS样式替换为如下代码
/* 用斜杆和星号包围的内容是注释信息,下面为说明文字
 * NOTE:
 * - The use of browser-specific styles (-moz-, -webkit-) should be avoided.
 *   If used, they may not render correctly for people reading the email in
 *   a different browser than the one from which the email was sent.
 * - The use of state-dependent styles (like a:hover) don't work because they
 *   don't match at the time the styles are made explicit. (In email, styles
 *   must be explicitly applied to all elements -- stylesheets get stripped.)
 */

/* This is the overall wrapper, it should be treated as the `body` section. */

.markdown-here-wrapper {
}

/* This spacing has been tweaked to closely match Gmail+Chrome "paragraph" (two line breaks) spacing.
Note that we only use a top margin and not a bottom margin -- this prevents the
"blank line" look at the top of the email (issue #243).
*/


/* To add site specific rules, you can use the `data-md-url` attribute that we
   add to the wrapper element. Note that rules like this are used depending
   on the URL you're *sending* from, not the URL where the recipient views it.
*/
/* .markdown-here-wrapper[data-md-url*="mail.yahoo."] ul { color: red; } */

pre, code {
  font-family: Avenir, "PingFangSC-Light";
}

code {
  margin: 0;
  padding: 0;
  background-color: #F8F8F8;
  padding: 0.2em 0.5em;
  font-size: 0.9em;
  border-radius: 2px;
  display: inline; /* added to fix Yahoo block display of inline code */
  white-space: pre-wrap;
}

pre {
  font-size: 1em;
  line-height: 1.2em;
}

pre code {
  margin: 0em 0em;
  white-space: pre;
  overflow: auto; /* fixes issue #70: Firefox/Thunderbird: Code blocks with horizontal scroll would have bad background colour */
  padding: 0.5em 0.7em;
  display: block !important; /* added to counteract the Yahoo-specific `code` rule; without this, code blocks in Blogger are broken */
}

/* In edit mode, Wordpress uses a `* { font: ...;} rule+style that makes highlighted
code look non-monospace. This rule will override it. */
.markdown-here-wrapper[data-md-url*="wordpress."] code span {
  font: inherit;
}

/* Wordpress adds a grey background to `pre` elements that doesn't go well with
our syntax highlighting. */
.markdown-here-wrapper[data-md-url*="wordpress."] pre {
  background-color: transparent;
}

/* This spacing has been tweaked to closely match Gmail+Chrome "paragraph" (two line breaks) spacing.
Note that we only use a top margin and not a bottom margin -- this prevents the
"blank line" look at the top of the email (issue #243).
*/
p{
  /* !important is needed here because Hotmail/Outlook.com uses !important to
     kill the margin in <p>. We need this to win. */
  font-family: Avenir, "PingFangSC-Light" !important;
  font-size: 15px !important;
  color: #333 !important;
  line-height: 1.8em !important;
  letter-spacing: 0.1em !important;
  margin: 0 !important; /* 增加段落边距 */
  text-align: justify !important;
}

table, pre, dl, blockquote, q{
  margin: 0em 0em;
  font-size: 15px !important;
}

/* 一级有序无序列表缩进*/

ul, ol {
  padding-left: 0em;
  margin: 0em 0em;
  font-size: 15px !important;
}

li{
  margin: 0em 0;
  font-family: Avenir, "PingFangSC-Light" !important;
  font-size: 15px !important;
  color: #333 !important;
  line-height: 1.8em !important;
  letter-spacing: 0.1em !important;
  margin: 0.5em 0.5em !important;
}

ul li {
  margin: 0em 0;
  font-family: Avenir, "PingFangSC-Light" !important;
  font-size: 15px !important;
  color: #333 !important;
  line-height: 1.8em !important;
  letter-spacing: 0.1em !important;
}

/* Smaller spacing for sub-lists 设置二级列表缩进*/
ul ul, ul ol, ol ul, ol ol {
  margin: 0;
  padding-left: 0em;
  font-size: 15px !important;
}

/* Use Roman numerals for sub-ordered-lists. (Like Github.) */
ol ol, ul ol {
  list-style-type: circle;
  font-size: 15px !important;
}

/* Use letters for sub-sub-ordered lists. (Like Github.) */
ul ul ol, ul ol ol, ol ul ol, ol ol ol {
  list-style-type: square;
  font-size: 15px !important;
}

dl {
  padding: 0;
}

dl dt {
  font-size: 1em;
  font-weight: bold;
  font-style: italic;
}

dl dd {
  margin: 0 0em;
  padding: 0 1em;
}

blockquote, q {
  border-left: 4px solid #DDD;
  /* background-color: #fafafa;*/
  padding: 0em; /* 删除内边距 */
  margin: 0em 0em;
  color: #777;
  quotes: none;
}

/* 设置引用文本颜色 */
blockquote p {
  color: rgb(119, 117, 117) !important
}

blockquote::before, blockquote::after, q::before, q::after {
  content: none;
}

/* 设置1-6级标题颜色、文字大小、居中 */

h1, h2, h3, h4, h5, h6 {
  margin: 0.5em 0 0em;
  padding: 0;
  font-weight: bold;
  color: orange;
  text-align: center;
}

h1 {
  font-size: 1.5em;
  border-bottom: 1px solid #ddd;
}

h2 {
  font-size: 1.4em;
  border-bottom: 1px solid #eee;
}

h3 {
  font-size: 1.3em;
}

h4 {
  font-size: 1.2em;
}

h5 {
  font-size: 1.1em;
}

h6 {
  font-size: 1em;
  color: #777;
}

/* 设置表格字体、大小、边框 */

table {
  border-collapse: collapse;
  border-spacing: 0;
  font-size: .8em;
  border: 0;
  font-family: Avenir, "PingFangSC-Light";
}

tbody {
  margin: 0;
  padding: 0;
  border: 0;
}

table tr {
  border: 0;
  border-top: 1px solid #CCC;
  background-color: white;
  margin: 0;
  padding: 0;

}

table tr:nth-child(2n) {
  background-color: #F8F8F8;
}

table tr th, table tr td {
  font-size: 0.8em;
  border: 1px solid #CCC;
  margin: 0;
  padding: 0.5em 1em;
}

table tr th {
 font-weight: bold;
 background-color: #F0F0F0;
}
相关推荐
©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页