使用 Pandoc 转换时如何维护 HTML 内部链接 [英] How to maintain HTML internal links when converting with Pandoc

查看:46
本文介绍了使用 Pandoc 转换时如何维护 HTML 内部链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Pandoc 从 html 转换为 pdf.输出相当不错,仍然使用命令 pandoc index.html -o output.pdf 我丢失了所有内部链接(从目录到章节,从文本到脚注等).

I am trying to convert from html to pdf with Pandoc. The output is pretty nice, still with the command pandoc index.html -o output.pdfI lose all my internal links (from table of contents to chapters, from text to footnotes, etc).

在我的 HTML 中,这是 outdegree 链接

In my HTML this is the outdegree link

<p class="calibre18"><a href="#calibre_link-73"><span class="calibre8">CHAPTER ONE</span></a><br class="calibre19"></br><a href="#calibre_link-73">The Ever Expanding Domain of Computation</a></p>

然后降落在这里

<a href="#calibre_link-73">Chapter 1</a> makes the case that because of...

这里

<p class="calibre18"><a href="#calibre_link-73"><span class="calibre8">CHAPTER ONE</span></a><br class="calibre19"></br><a href="#calibre_link-73">The Ever Expanding Domain of Computation</a></p>...

有什么办法可以将所有链接也保留在输出中吗?

Is there any way to keep all the links also in the output?

推荐答案

Pandoc 用户指南内部链接部分

目前支持 HTML 格式(包括 HTML 幻灯片和 EPUB)、LaTeX 和 ConTeXt 的内部链接.

Internal links are currently supported for HTML formats (including HTML slide shows and EPUB), LaTeX, and ConTeXt.

这表明 PDF 输出目前不支持内部链接,即使 PDF 输出是通过 LaTeX 生成的.

This suggests that internal links aren't currently supported for PDF output, even though the PDF output is generated via LaTeX.

这篇关于使用 Pandoc 转换时如何维护 HTML 内部链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆