在 asciidoc 中包含 docx 文件?

Include docx file in asciidoc?

我正在使用 asciidoc 和 asciidoctor 为当前项目创建文档。

我注意到文档中有一个包含文件的标记,如下所示:

link:index.html 要么 link:protocol.json[Open the JSON file]

是否可以包含一个 docx 文件作为 link 以便它可以在外部打开或能够下载? 我还可以将此文件放在我的 asciidoc 目录中的一个文件夹中(为了组织起见)并且仍然能够正确引用它吗?

你这样写:

Open this link:somefile.docx[Word file] should work.

Or this link:file:///C:/Users/xxx/docs/otherfile.docx[second file].

它适用于相对路径或绝对路径。


您需要确保文件路径对于文档的 reader 是正确的。

示例:如果您将 Asciidoctor 生成的 HTML 文件放在网络服务器(public 或内联网)上,那么引用本地 C: 的路径不是一个好主意。

如果不了解 publication/distribution 工具链,很难告诉您该做什么。