asciidoctor / asciidoctor-maven-plugin

A Maven plugin that uses Asciidoctor via JRuby to process AsciiDoc source files within the project.
http://asciidoctor.org
Apache License 2.0
317 stars 122 forks source link

Support `example$` for Antora symlinks #588

Open gastaldi opened 2 years ago

gastaldi commented 2 years ago

What is this issue about?

Description Antora defines a special example$ directory for symlinks (see https://docs.antora.org/antora/latest/symlinks/ for the full explanation) and that does not work with the Asciidoctor maven plugin (see https://github.com/quarkiverse/quarkus-neo4j/pull/83)

[ERROR] asciidoctor: ERROR: index.adoc: line 60: include file not found: /Users/ggastald/workspace/quarkiverse/quarkus-neo4j/docs/modules/ROOT/pages/example$Fruit.java
[ERROR] asciidoctor: ERROR: index.adoc: line 186: include file not found: /Users/ggastald/workspace/quarkiverse/quarkus-neo4j/docs/modules/ROOT/pages/example$Fruit.java
[ERROR] asciidoctor: ERROR: index.adoc: line 196: include file not found: /Users/ggastald/workspace/quarkiverse/quarkus-neo4j/docs/modules/ROOT/pages/example$FruitResource.java

Environment information

abelsromero commented 2 years ago

Antora adds this and many other features that are not part of asciidoctor, hence the plugin does not understand them. For instance, the example$ is also dependant on the Antora's module definition, and it's not the goal of the plugin to extends beyond what asciidoctor does.

On a personal note, I think Antora is a very capable CLI tool and I don't feel adding an additional layer on top of it is worth the effort. If you are interested in building via Maven though, you can work arround with frontend-maven-plugin to run node https://abelsromero.github.io/blog/2020/antora-with-maven.html.

mojavelinux commented 2 years ago

I was about to post something very similar to what Abel wrote. There's one thing I liked to add.

We could consider the possibility of supporting an Antora "mode" if antora.yml is detected in much the way the IntelliJ plugin exists. What that mode would do is activate an xref resolve extension that can make sense of xrefs that use the Antora coordinate system. If the extension is maintained separately, then all the plugin would need to do is add it automatically. Or, the end user could do so instead.

abelsromero commented 2 years ago

What that mode would do is activate an xref resolve extension that can make sense of xrefs that use the Antora coordinate system.

It's a worthy option but I fail to see the end goal here. We could resolve the references in the same module, but at the end you don't want to build the docs via "pure asciidoctor" if it's an Antora project right? The only case I can imagine is if the docs are re-used somehow in 2 builds like I suggested in https://github.com/quarkiverse/quarkus-neo4j/pull/83#issuecomment-1204356313.

mojavelinux commented 2 years ago

Yep. I'm certainly not disagreeing with you. Just sharing some possible ideas for how to think about it.

abelsromero commented 2 years ago

Ok, from the other story, it seems the idea is getting a preview, it's reasonable to explore it.