繁体   English   中英

Pandoc Markdown 到 HTML 块引用样式

[英]Pandoc Markdown to HTML blockquote style

我试图找到一个很好的解决方案来在 Markdown 中编写我的电子邮件,并在 Thunderbird 中为一般消费设置样式。

我之前的解决方案,插件Markdown-here没有维护,并且不再适用于最新的 Thunderbird 版本。

我尝试成功的一种方法是使用 pandoc,并通过 Insert- Insert->HTML HTML 文件的内容。

例如:

email.md

Hi there, *this* is a **test** email written in `markdown`

pandoc 命令

pandoc email.md -t html -o email.html

email.html

<p>Hi there, <em>this</em> is a <strong>test</strong> email written in <code>markdown</code></p>

但是,格式并不总是我想要的。 例如,在 Markdown-here 中,它曾经类似于 StackOverflow 的 blockquotes 渲染

块引用看起来像这样

但是,在我的 pandoc->Thunderbird 工作流程中,HTML 元素如下:

<blockquote>
<p>Blockquotes looks like this</p>
</blockquote>

呈现为缩进文本,如:

块引用看起来像这样

这使我的电子邮件不太容易跟踪。

我读过有关具有--css标志的 pandoc ,您可以在其中定义要使用的 CSS 表,例如s --css=styling.css 但是,我尝试过的任何方法似乎都不起作用。

Does anyone know how to embed changes to the blockquote styles of generated HTML in pandoc to more closely follow the rendered markdown styles of StackOverflow and GitHub?

根据文档,您可以使用-c标志链接到 CSS 文件,我们可以查看 SO 的块引用样式,即:

   blockquote p::before{
    content: "";
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    border-radius: 8px;
    background: #c8ccd0;
    }
blockquote{
    color:#535a60;
    padding:.8em .8em .8em 1em;
    position: relative;
}

因此,使用该样式运行以下命令应该可以满足您的需求。

pandoc -s -c <StyleFile>.css <Content>.md -o <Output>.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM