You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何解决Asciidoc文档front-cover-image指令无效问题

Asciidoc封面页不生效的解决方法

核心问题:front-cover-image 属性格式错误

你当前把完整的image::嵌入语法直接赋值给属性,不符合Asciidoc的属性规范。front-cover-image只需要指定图片的路径/文件名(结合已设置的imagesdir),不需要包含image::标签和属性参数。

修正后的文档头配置

= My App: Software Design Document
Giuseppe Greco <giuseppe.greco@agamura.com>
v.0.1, 2024-09-18: First draft
:doctype: book
:sectnums:
:toc:
:toclevels: 4
:description: Software Design Document
:imagesdir: ./images
:appname: myApp
:front-cover-image: cover-page.svg
:front-cover-image-width: 600
:front-cover-image-height: 400

额外注意事项

  • front-cover-image 属性仅对PDF输出生效(需使用asciidoctor-pdf工具编译),如果是生成HTML,这个属性不会起作用,需要在文档最开头手动添加图片块:
    image::cover-page.svg[alt="Cover Page", width=600, height=400, align="center"]
    
    == 目录(或其他章节)
    
  • 确保cover-page.svg确实存在于./images目录下,路径大小写和文件名完全匹配(部分系统区分大小写)。

内容的提问来源于stack exchange,提问作者j3d

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.17 11:32:33