简体   繁体   English

使用Pandoc从HTML META标记创建YAML元数据

[英]Use Pandoc to create YAML Metadata from HTML META Tags

I have a batch of HTML files. 我有一批HTML文件。 Each has its own title and description in the standard HTML meta tags. 每个标准HTML元标记中都有自己的标题和描述。 I'd like to convert them all to Markdown, but I'd like to retain that metadata, in the form of a YAML metadata header, at the top of the resulting markdown files. 我想将它们全部转换为Markdown,但我希望在生成的markdown文件的顶部以YAML元数据头的形式保留元数据。 Is it possible to do this with Pandoc? 用Pandoc可以做到这一点吗?

是的,pandoc会执行此操作,但前提是您使用的是1.12.3或更高版本。

pandoc -f html -t markdown -s input.html -o output.md

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

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