如何包含原始HTML文件? [英] How to include raw html file?

查看:106
本文介绍了如何包含原始HTML文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我可以使用 raw 指令轻松地包含原始html文件,如下所示:

In rst, I can easily include a raw html file using the raw directive as follows:

.. raw:: html
    :file: some_file.html

有没有一种简单的方法可以用asciidoctor做到这一点?我了解,如果我用 ++++ 包装 some_file.html 的内容,则可以使用 include :: 在asciidoc中,但是我要避免手动编辑 some_file.html

Is there a simple way to do this with asciidoctor? I understand that if I wrap the contents of some_file.html with ++++ that I can then use include:: in asciidoc, but I would like to avoid manually editing some_file.html.

推荐答案

Asciidoctor允许您将包含内容放入直通块中,理想情况下用空行包围,如下所示:

Asciidoctor allows you to put includes into a passthrough block, ideally surrounded by empty lines, like this:

++++
include::some_file.html[]
++++

在此周围添加空行可以防止将包含的文件内容解释为围绕包含内容的adoc文本的延续,如手册

Adding empty lines around this prevents interpretation of the included file contents as continuations of the adoc text surrounding the include, as described in the manual.

这篇关于如何包含原始HTML文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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