[英]How do I preserve identifiers while converting from HTML to Markdown with Pandoc
I can't find the right parameter for this. 我找不到正确的参数。
In my HTML-document I have a line like this: 在我的HTML文档中,有这样一行:
<h2 id="seminar-teil-1">Seminar Teil 1</h2>
Now I want to convert this .html-document to a Markdown-Document. 现在,我想将此.html文档转换为Markdown文档。 The end result should be:
最终结果应为:
## Seminar Teil 1 {#seminar-teil-1}
How do I get this done? 我该如何完成?
Ah! 啊! No wonder you were struggling.
难怪你在挣扎。 By default, identifiers are in fact preserved.
默认情况下,标识符实际上是保留的。
> pandoc -f html -t markdown
<h1 id="uid">Seminar 1</h1>
Output 产量
Seminar 1 {#uid}
=========
There is one special case though, when your identified matches the identifier which pandoc automatically generates then no identifier is emitted. 但是有一种特殊情况,当您识别出的与pandoc自动生成的标识符匹配时,则不会发出任何标识符。 The automatic identifier is basically a lower case alphanumeric version of the title interspersed with dashs (exactly like your custom identifier!).
自动标识符基本上是标题的小写字母数字版本,中间带有破折号(完全类似于您的自定义标识符!)。
To turn this feature off run pandoc as follows 要关闭此功能,请按以下方式运行pandoc
> pandoc -f html -t markdown-auto_identifiers
<h2 id="seminar-teil-1">Seminar Teil 1</h2>
Seminar Teil 1 {#seminar-teil-1}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.