Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anotra playbook sourced from a wrong location #1293

Closed
LukeCz opened this issue Feb 8, 2023 · 3 comments
Closed

Anotra playbook sourced from a wrong location #1293

LukeCz opened this issue Feb 8, 2023 · 3 comments

Comments

@LukeCz
Copy link

LukeCz commented Feb 8, 2023

Observed vs. expected behavior

Hi,
I found this by accident while investigating an issue similar to #1153 - plantuml is not rendered by Kroki in preview. It turned out that I do have 'kroki-fetch-diagram' defined but in yaml file that sits in an examples folder - see attached zip file. When I change it to false it all works.
I was expecting the plugin to look for antora-playbook.yaml in the root folder only and not in a random place.

Steps to reproduce

  1. Open attached repo and go to index.adoc - the diagram is not rendered.
  2. Remove last line from antora-playbook-local.yml - the diagram is rendered.

Environment

Plugin Version: 0.38.10

IntelliJ Details: IntelliJ IDEA 2022.3.2 (Community Edition)
Build #IC-223.8617.56, built on January 26, 2023
Runtime version: 17.0.5+1-b653.25 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 3006M
Cores: 20
Non-Bundled Plugins:
idea.plugin.protoeditor (223.8214.6)
com.intellij.grazie.pro (0.3.202-223)
org.asciidoctor.intellij.asciidoc (0.38.10)

Kotlin: 223-1.8.0-release-345-IJ8617.56

docs.zip

@LukeCz LukeCz added the bug label Feb 8, 2023
@ahus1
Copy link
Contributor

ahus1 commented Feb 8, 2023

Thanks for raising this issue. I agree that a playbook from an examples folder shouldn't be picked up.

At the same time I see people placing them in other folders outside of the components, still accept if they are placed not in the root folder as long as they are placed outside of a component.

I'll see if I can tackle this in an upcoming release of the plugin, or if someone would volunteer for a PR here.

The method AsciiDocAntoraPlaybookIndex#getVirtualFiles() could have in its inner loop a check to call AsciiDocUtil.findAntoraModuleDir(project, fileBaseDir) to check if the file is part of a component, and then ignore it.

@ahus1
Copy link
Contributor

ahus1 commented Feb 10, 2023

Fixed in upcoming release.

@ahus1
Copy link
Contributor

ahus1 commented Feb 28, 2023

There's now pre-release 0.38.11 that includes this fix.

The pre-release of the plugin is available from GitHub releases and the IntelliJ AsciiDoc EAP repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants