pandoc html docx css,html - Inline CSS with Pandoc - Stack Overflow

I apologize if a simple way to this programmatically (not by copying/pasting in a browser field and clicking a button to convert) is documented somewhere. In my searches and reading I cannot find it.

I would like to programmatically turn a Markdown and CSS file into what sounds like may be called "inline" CSS.For example:

This Markdown file (file.md)

# Install

Install instructions

## Update

Update instructions

This CSS file (style.css)

h1 {

font-size: 100px;

}

h2 {

color: red;

}

Becomes this (file.html)

Install

Install instructions

Update

Update instructions

I am transforming the Markdown to HTML with Pandoc

pandoc -f markdown -t html file.md -o file.html

When I use

pandoc -f markdown -t html file.md -o file.html --css=style.css --self-contained

(or --standalone)

It returns

file

code{white-space: pre-wrap;}

span.smallcaps{font-variant: small-caps;}

span.underline{text-decoration: underline;}

div.column{display: inline-block; vertical-align: top; width: 50%;}

Install

Install instructions

Update

Update instructions

As mentioned above this is not my goal. I would like the CSS to be strictly "inline":

Install

Is anyone aware of a tool or script already written than can programmatically achieve this? I have searched and come up empty. Ideally I could use Pandoc for this, but I cannot discover a way.

I do not care if the

and
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值