PacoVK / antora-confluence

Plugin to publish your Antora docs to Confluence
Apache License 2.0
14 stars 3 forks source link

ENHANCEMENT: Page hierarchy based on nav.adoc #26

Open andreas-hempel opened 7 months ago

andreas-hempel commented 7 months ago

Hello @PacoVK,

in Antora I define the navigation for the generated HTML in the nav.adoc file.

image

* xref:index.adoc[]
** xref:segments.adoc[]
*** xref:segments/message-header.adoc[]
** xref:tables.adoc[]

When I transfer the documentation to confluence, the page hierarchy from the nav.adoc file is lost.

image

Is there a possibility in a future version that the page hierarchy in confluence will correspond to the one defined in the nav.adoc file?

In the attachment you will find an example project to illustrate.

confluence-issue.zip

WORAROUND: I currently have to move the pages manually. If I execute the transfer from Antora again, the page hierarchy is retained, new pages are then inserted at the top level and have to be edited manually. It would be great if this could be done automatically, especially for larger documentation.

Kind Regards, Andreas

PacoVK commented 7 months ago

@andreas-hempel thanks for this input. I also thought into that direction, yet failed to find a suitable approach for that. There is a simple technical reason, the output plugin interface receives the already translated .html files and i do not have access to the asciidoc source (at least no convinient). However, i keep this in mind and will try to make this possible, since this would be a really nice feature.

andreas-hempel commented 7 months ago

Hello @PacoVK,

the generated navigation is contained in the \

DrackThor commented 4 months ago

I guess the idea is good 🤔 would also very much like this feature! although I can't help with the coding, I'd be happy to help with testing, docs and feedback 😄

PacoVK commented 3 months ago

I really put many thoughts into this, because i do see value in here. However i still could not manage to get a satisfying solution to that. Here are my current blockers, in case someone has an idea how to overcome this:

The navigation is totally free and up to the user how to structure and title. This can lead to lots of duplicates and naming conflicts. While Antora could handle that easily, Confluence cannot due to the constraint how pages are designed and Captain could eg. not guess what is a cross-ref and which is the main link in. a nav. This means every page that get linked in a nav more than once across the whole Antora docs, would be duplicated and would also need a prefix, which in the end also means changes to that page are very hard to propagate and track.

any idea/ recommendation would be appreciated :)

slonopotamus commented 3 months ago

not guess what is a cross-ref and which is the main link in. a nav

Hmm... In Antora, page has breadcrumbs at its top. So it knows what is its "primary" path, no?

UPD: Yep, I've just tried. The first page reference in nav.adoc wins and becomes primary.