错误与警告
Asciidoctor 发出的所有应用程序消息(即,debug、info、warning、error 或 fatal)都会写入日志记录器。默认情况下,只有 warning、error 和 fatal 消息会被记录。当使用 CLI 时,日志记录器通过 stderr(即标准错误)将消息路由到控制台。
通知类型
- DEBUG
-
Debug 消息可洞察软件的运行情况,有助于跟踪问题或意外行为。目前,Asciidoctor 不会在此级别记录任何消息。但是,扩展可能会这样做。
- INFO
-
Info 消息不会停止转换,但它们会指示可能存在的问题,并且输出可能并非您所期望的那样。
- WARN (WARNING)
-
Warnings 消息不会停止转换,但它们会指示可能存在的问题,并且输出很可能并非您所期望的那样。在 CLI 输出中,Asciidoctor 将这些消息标记为
WARNING而不是WARN。 - ERROR
-
Error 消息不会停止转换,但输出文档几乎肯定会出错。
- FATAL (FAILED)
-
Failures 是致命的;不会产生输出文档。如果指定了
--traceCLI 选项,消息可能伴随堆栈跟踪。在 CLI 输出中,Asciidoctor 将这些消息标记为FAILED而不是FATAL。
以下部分中列出的消息可能包含一些具有代表性的占位符
- <docname>
-
表示正在处理的源文件的基本名称(例如,
sample.adoc)。 - <file>
-
表示指向输入文件或其他引用的文件的路径。
- <uri>
-
表示正在引用的 URI(即 URL)。
- <x> 或 <y>
-
消息中其他上下文信息的占位符。
Debug 消息
| 消息 | 故障排除 |
|---|---|
unknown style for <y> block: <x> |
处理器找不到为具有自定义样式 <x> 的 <y> 块注册的扩展。注册自定义块的扩展不是必需的,因此此消息仅供参考。如果未注册扩展,处理器将回退到块的默认语义。该块将被渲染,就好像自定义样式不存在一样。 |
unknown name for block macro: <x> |
处理器找不到为名为 <x> 的块宏注册的扩展。注册自定义块宏的扩展不是必需的,因此此消息仅供参考。如果未注册扩展,处理器将使块宏保持未处理状态(将其视为段落文本)。 |
unknown style for paragraph: <x> |
处理器找不到为具有自定义样式 <x> 的段落注册的扩展。注册自定义段落的扩展不是必需的,因此此消息仅供参考。如果未注册扩展,处理器将回退到段落的默认语义。该段落将被渲染,就好像自定义样式不存在一样。 |
Info 消息
| 消息 | 故障排除 |
|---|---|
possible invalid reference: <x> |
处理器无法验证名为 <x> 的内部引用。此消息并不明确表示缺少引用。相反,它表明引用(即锚点)不在可以验证引用的位置。 |
Warning 消息
| 消息 | 故障排除 |
|---|---|
abstract block cannot be used in a document without a title when doctype is book. Excluding block content. |
Invalid book document structure. |
cannot retrieve contents of <x> at URI: <uri> (allow-uri-read attribute not enabled) |
只有当 |
could not retrieve contents of <x> at URI: <uri> |
Web address not found. |
could not retrieve image data from URI: <uri> |
Web address not found. Only occurs with |
dropping line containing reference to missing attribute: <x> |
无法解析属性,并且 |
file does not exist or cannot be read: <file> |
您指定了一个样式表( |
gem 'concurrent-ruby' is not installed. This gem is recommended when registering custom converters. |
您已注册自定义转换器,但尚未安装 concurrent-ruby gem。 |
gem 'concurrent-ruby' is not installed. This gem is recommended when using custom backend templates. |
您正在使用自定义模板( |
image to embed not found or not readable: <file> |
您使用了 |
include file not readable: <file> |
您没有访问该文件的权限。 |
input path <file> is a <x>, not a file |
该路径不是一个文件(可能是一个套接字或块设备)。 |
optional gem 'asciimath' is not installed. Functionality disabled. |
asciimath 是将 AsciiMath 表达式从 AsciiDoc 转换为 DocBook 时必需的库。 |
optional gem 'rouge' is not installed. Functionality disabled. |
Rouge 用于在 |
skipping reference to missing attribute: <x> |
无法解析属性,并且 |
tables must have at least one body row |
|
tag '<x>' not found in include file: <file> |
您尝试通过标记区域进行包含,但包含的文档没有该标记。 |
<docname>: id assigned to <type> already in use: <id> |
<id> 是一个重复的 ID,意味着它已被分配给一个 <type> 节点(例如,section、block、anchor)。如果您在 <docname> 中未看到问题,请检查重复的 ID 是否来自被包含的文件。 |
<docname> callout list item index: expected <x> got <y> |
Callouts 应该像任何有序列表一样按数字顺序排列。 |
<docname> include <x> not readable: <y> |
如果 <y> 是一个文件,您是否对其具有读取权限?如果它是一个 URI 并且设置了 |
<docname> include file not found: <file> |
可能是拼写错误或文件丢失。如果不是,请确保您了解搜索过程。 |
<docname> invalid empty <x> detected in style attribute |
块属性中的第一个位置属性无法解析。 |
<docname> invalid style for <x> block: <y> |
您已为块添加自定义样式,但尚未注册自定义块扩展来处理它。 |
<docname> invalid style for paragraph: <x> |
在段落之前有一行 |
<docname> list item index: expected <x>, got <y> |
您在有序列表中提供了明确的数字,但它们不是连续的。Asciidoctor 会为您重新编号,并发出此警告。 |
<docname> multiple ids detected in style attribute |
块样式中不能指定多个 ID(例如, |
<docname> no callouts refer to list item <x> |
呼叫点丢失或未识别。在源代码列表中,呼叫点是否是行上的最后一个内容? |
<docname> section title out of sequence |
无效的文档结构。检查节级别。 |
Error 消息
| 消息 | 故障排除 |
|---|---|
input file <file> missing or cannot be read |
检查文件是否存在以及文件名是否拼写正确。 |
include file has illegal reference to ancestor of jail; recovering automatically |
安全模式限制访问基础目录之外的包含文件。 |
input file and output file cannot be the same: <file> |
选择不同的输出目录或文件名。 |
partintro block can only be used when doctype is book and it's a child of a part section. Excluding block content. |
Invalid book document structure. |
unmatched macro: endif::<x>[] |
|
<docname> dropping cell because it exceeds specified number of columns |
|
<docname> illegal block content outside of partintro block |
Invalid book document structure. |
<docname> invalid part, must have at least one section (e.g., chapter, appendix, etc.) |
Invalid book document structure. |
<docname> malformed manpage title |
文档不符合所声明的 manpage doctype 所需的结构。 |
<docname> malformed name section body |
文档不符合所声明的 manpage doctype 所需的结构。 |
<docname> maximum include depth of 64 exceeded |
您的文件是否包含自身,直接或间接? |
<docname> mismatched macro: endif::<x>[], expected endif::<y>[] |
ifdef/endif 块必须严格嵌套。 |
<docname> name section expected |
文档不符合所声明的 manpage doctype 所需的结构。 |
<docname> name section title must be at level 1 |
文档不符合所声明的 manpage doctype 所需的结构。 |
<docname> only book doctypes can contain level 0 sections |
Illegal use of a level-0 section when doctype is not book. |
<docname> table missing leading separator, recovering automatically |
检查行开头是否缺少单元格分隔符。 |