1

I would like to inlcude a PlantUML file inside an Asciidoc file and build an Antora site.

foo.adoc

[plantuml, bar, svg]
....
include::bar.puml[]
....

bar.puml

@startuml
<... valid PlantUML>
@enduml

The PlantUML does show up correctly inside my IDE (IntelliJ).

Problem

When i run antora antora-playbook.yml, i get the following error:

ERROR (asciidoctor): target of include not found: bar.puml
    file: /$PROJECT_PATH/docs/modules/ROOT/pages/foo.adoc:11
    source: /$PROJECT_PATH (branch: #branch-name <worktree> | start path: docs)
Skipping plantuml block. GET https://kroki.io/plantuml/svg/<image-id> - server returns an empty response or a 404 status code

Everything works fine if i use inline PlantUML instead of an include statement.

Update

I've already tried to use the following Antora Resource ID's:

  • include::page$bar.puml[]
  • include::ROOT:page$bar.puml[]
  • include::ProjectName:ROOT:page$bar.puml[]
  • include::{docdir}/bar.puml[]

The error message remains the same: target of include not found: ...

My project structure looks like this:

- modules
  - antora.yml
  - antora-playbook.yml
  - ROOT
    - pages
      - foo.adoc
      - bar.puml
Miracoly
  • 63
  • 7

1 Answers1

3

The root cause is: ERROR (asciidoctor): target of include not found: bar.puml. When working with Antora, you should reference a resource using an Antora resource ID: https://docs.antora.org/antora/latest/page/resource-id/

[plantuml, bar, svg]
....
include::example$bar.puml[]
....

https://docs.antora.org/antora/latest/page/include-an-example/

Mogztter
  • 421
  • 3
  • 3
  • Thx. I've added an update to th question regarding your answer. – Miracoly Dec 06 '22 at 09:17
  • 2
    you should create an `examples` directory next to `pages` and move "bar.puml" in it. Then, use `include::example$bar.puml[]`. The `pages` directory is reserved for AsciiDoc files. – Mogztter Dec 30 '22 at 19:18
  • Thank you very much. After creating an `examples` directory under `ROOT` and putting the puml file there, i was able to include it and build the antora site successfully. – Miracoly Jan 15 '23 at 21:45