asciidoctor / asciidoctor-intellij-plugin

AsciiDoc plugin for products on the IntelliJ platform (IDEA, RubyMine, etc)
https://intellij-asciidoc-plugin.ahus1.de/
Apache License 2.0
355 stars 145 forks source link

Project or structure view based on the selected nav.adoc file #958

Open RayOffiah opened 2 years ago

RayOffiah commented 2 years ago

Why the new feature should be added

This idea is related to Antora projects only.

At the moment, the files in an Antora based project are listed in alphabetical order in the project view. It might be useful to provide a hierarchical structure view based on the structure defined in the nav.adoc file. This would be handy for pages that run in a defined order (such as the pages that make up a tutorial).

How the new feature should work

I don't think there's a way to arrange the files in the project in any other way than what's already provided in the IDE, so this would be quite a lot of work to implement.

To begin with, an Antora project can contain a nav.adoc file for each module. The plugin would need to register them all to build the structure for rendering in the project/structure view.

In the far-flung future, Antora might be used to generate books as well as sites, in which case, authors would find it very useful to see the structure of their book in the project view.

ahus1 commented 2 years ago

Thanks for suggesting that.

I'm not sure how to build something like that with the APIs of IntelliJ I know in the project view. If you would come across an IntelliJ plugin that achieves something similar, this could help figuring out how to do this.

The structure view is what is the most flexible IMHO, and it is something the plugin already populates. Traditionally it shows the structure of the current file, maybe this could be lifted in the context of Antora. Let's see.

For the time being, there is some existing functionality of of navigating AsciiDoc files:

When a user opens a nav.adoc in the editor,

RayOffiah commented 2 years ago

All makes sense to me.

The structure view is the one to go for, as. don't think I've come across any plugins that mess around with the existing project views; they just create their own:

https://plugins.jetbrains.com/plugin/1800-database-navigator

image