需要 inline_macro 个关于文件位置的示例和帮助

Need inline_macro example and help about file location

我想为这些类型向 asciidoctor 添加额外的宏:

path:[some path value]
label:[some label text]
replace:[some value to become replaced by the user]
screen:[something the users sees on screen]

我主要想让它渲染一些 CSS 类,同时渲染到 HTML5。我找到了几个关于如何为 asciidoctor 编写宏的资源,但我不明白要点。我写的 ruby 代码和 类 在哪里放置或插入?这是我找到的示例页面:https://docs.asciidoctor.org/asciidoctor/latest/extensions/inline-macro-processor/

但是我没有找到有关放置位置的简单分步信息?

谁能告诉我:

我使用 apt-get install asciidoctor 在 Ubuntu 20.04 上安装了 asciidoctor。到目前为止似乎有效。但是我没有找到预定义宏 btnkbdmenu.

的文件

我在这里有点迷路...感谢任何帮助。

PS。我知道 [.label]#some label text# 放置 CSS 类 的语法,但我想让它通用并且也可用于以后生成 PDF .

经过多次不同的尝试和研究,我终于发现它很容易。只需使用 -r comandline 参数将 asciidoctor 指向您要包含的文件:

asciidoctor -r ~/tools/asciidoctor_patch/include_asciidoc.rb

可悲的是,整个 asciidoctor 文档仅将此参数命名为“require”,甚至没有提及将其用于扩展。我也没有找到任何来源提到使用 -r 来包含宏。