asciidoctor / asciidoctor-vscode

AsciiDoc support for Visual Studio Code using Asciidoctor
Other
340 stars 97 forks source link

antora.yml search could be improved to avoid scanning the whole workspace #814

Closed alexandruavadanii closed 1 year ago

alexandruavadanii commented 1 year ago

Please provide details about:

ggrossetie commented 1 year ago

For reference, we are looking for antora.yml on all workspaces because we want to build a "complete" content catalog (at least for all the documentation components available locally).

Instead, what we could do is build a content catalog for the current documentation component. In other words, if I open an AsciiDoc file in workspace/**/<dir>/modules/**/pages/**/**/file.adoc or workspace/**/<dir>/modules/**/partials/**/**/file.adoc, the extension will try to read a YAML file at workspace/**/<dir>/antora.yml.

The only limitation is when the user has more than one documentation component in their workspaces. In this case, I don't see how we can automatically detect them without using a fuzzy glob search **/antora.yml.

We should probably introduce a settings (or a configuration file) where the user can define where the documentation components are located?

@mojavelinux any thoughts?

ggrossetie commented 1 year ago

It's important to note that we don't know for sure that the locally documentation components are part of the same documentation site. In other words, we might include unrelated documentation components in the content catalog.

ggrossetie commented 1 year ago

The IDEA extension relies on the Intellij search index so looking for **/antora.yml is relatively fast.