我使用 asciidoctor-maven-plugin(1.5.3)
将 asciidoc 文件转换为 pdf 和 html 文件。
问题:
创建的 pdf 文件包含警告图标 - 因此,一切都很好。
另一方面,html 文件似乎没有以正确的方式创建 - 警告图标丢失。没有文本/标题,只有一个奇怪的占位符。
我尝试使用 :icons: font
backend attribute , 其中font
是我在 asciidoc 文档中找到的唯一选项。
(顺便说一句,这与在 <icons>font</icons>
中添加 pom.xml
相同。)
font
选项应显示来自 http://fortawesome.github.io/Font-Awesome/icons/ 的图标但事实并非如此。
问题:
我是否必须从任何地方导入这些图标或下载它们并使用 :iconsdir: path/to/icons
特别包含它们? backend attribute ?
pom.xml
的重要部分看起来像这样。
<configuration>
<backend>html5</backend>
<sourceHighlighter>coderay</sourceHighlighter>
<attributes>
<imagesdir>./images</imagesdir>
<toc>left</toc>
<icons>font</icons>
<sectanchors>true</sectanchors>
<idprefix/>
<idseparator>-</idseparator>
</attributes>
</configuration>
最佳答案
好吧,这很尴尬,至少是故事的一半。
- 尴尬的部分
我犯的实际错误是使用了 noscript firefox plugin
, 这不允许使用 fontawesome...
.
事实上,我必须明确允许 cloudfare.com
在 noscript
使其发挥作用。
所以,我的 pom.xml
保留属性 <icons>font</icons>
.
- 好的部分
我发现了如何使用自定义图标:
- 声明
<iconsdir>./images/icons</iconsdir>
(这也是默认的,相对于源目录。) - 复制其中的一些图标。我从 here 得到的. (注意名称:
note.png
为NOTE: This is a note.
) - 更改
<icons>font</icons>
至<icons>image</icons>
关于html - 使用 Maven 插件将 asciidoc 转换为 html5 时如何启用(自定义)警告图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42130660/