将asciidoc文件合并到一个主asciidoc文件中

时间:2018-10-16 08:40:31

标签: ruby asciidoc spring-restdocs

我有一个主 .adoc 文件,该文件有几个 includes :: 指向包含相关代码段的文件夹。

我正在使用以下ruby脚本来实现这一目标-https://raw.githubusercontent.com/asciidoctor/asciidoctor-extensions-lab/master/scripts/asciidoc-coalescer.rb

文件夹结构 generate-snippets / order-email-output-documentation / order-email-output 包含必需的 .adoc 文件待合并

以下内容不包含各种 .adoc 文件,但出现错误-

asciidoctor: WARNING: dropping line containing reference to missing attribute: order-email asciidoctor: WARNING: dropping line containing reference to missing attribute: order-email === Request fields Unresolved directive in email-output.adoc - include::{order-email}/order-email-output/request-fields.adoc[] === Example request body Unresolved directive in email-output.adoc - include::{order-email}/order-email-output/request-body.adoc[]

= Test Service
:doctype: book
:icons: font
:source-highlighter: highlightjs
:toc: left
:toclevels: 4
:sectlinks:


:snippets: generated-snippets
:order-email: {snippets}/order-email-output-documentation

=== Request fields
include::{order-email}/order-email-output/request-fields.adoc[]
=== Example request body
include::{order-email}/order-email-output/request-body.adoc[]

但是,当我删除相对路径映射并替换为绝对路径时,它就起作用了,并且我得到了 :: includes 指令,该指令包含来自其他 .adoc 的内容文件-

= Test Service
:doctype: book
:icons: font
:source-highlighter: highlightjs
:toc: left
:toclevels: 4
:sectlinks:

=== Request fields
include::generated-snippets/order-email-output-documentation/order-email- 
output/request-fields.adoc[]
=== Example request body
include::generated-snippets/order-email-output-documentation/order-email- 
output/request-body.adoc[]

不确定为什么会这样!想知道这是否与ruby脚本中的regex模式有关?

任何帮助将不胜感激!

谢谢!

0 个答案:

没有答案