-
Notifications
You must be signed in to change notification settings - Fork 97
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
Support Antora #434
Comments
Antora support in the IntelliJ Asciidoctor Plugin is excellent and was the only reason for me to install and use IntelliJ. But my main editor is VSC and of course I would like to do also much more in VSC when working with asciidoc files. Another point is: It is very easy to install VSC also without admin rights and the asciidoctor-vscode plugin even works in Azure Data Studio. And it is always allowed to install Azure Data Studio in my projects, because it is installed together with SSMS (SQL Server Management Studio). So normally I find ways to install and use this VSC Plugin, but it is much harder to be allowed to install and use IntelliJ. |
The recording: https://media.ccc.de/v/froscon2021-2656-online-dokumentation_fur_nutzer_mit_asciidoc_und_antora German only :( |
It would be good to have a list of capabilities that mean "supporting Antora" so that we can progress them. I'm beginning to use Antora on a project and would like some of these capabilities also. We have quite a lot of issues requesting support now (#230, #358, #380 and #409). Perhaps we can use this issue to scope out some requirements. What are the most important things? From the current issues it seems to be:
How do achieve this concretely?
I don't speak German... I also haven't used the IntelliJ tool -- however there is a good feature list on the extension docs which is probably where we should start: https://intellij-asciidoc-plugin.ahus1.de/docs/users-guide/features/advanced/antora.html |
I'm investigating the AsciiDoc with Antora as alternative solution to Markdown with MkDocs for middle and big architecture documentation projects (many products, components, branches etc.). I'm also investigating the issues with relative image rendering (PlantUML, Vega etc.), completion support for xrefs and others in VSCode. @Skeeve the video above now encouraged me to continue investigating the issues and help with reporting, testing and may be resolving them... @danyill in the Q&A session from the video the maintainer (Alexander Schwartz) of IntelliJ AsciiDoc plugin is talking about sharing knowledge and support (chat, online meeting etc.) if similar features are needed in VSCode and somebody wants to implement them :) Lets start with the feature list and known issues... |
💯 I've created a similar issue on the browser extension: asciidoctor/asciidoctor-browser-extension#299. I guess the first would be to detect that we are in an Antora module (probably locating the |
Hi @Mogztter - thanks for summoning me. I am happy to support in answering questions like "How did you..." and "Why did you...", also "What did you do before/after...". Pick my brain :-) Regarding the video: I pre-recorded the same talk in English for DevConf.US and also FOSDEM, see https://www.youtube.com/watch?v=MG-sajf2PP4 for details. As it was pre-recorded, there is no Q&A at the end. DevConf.US published a recording that included the Q&A as well, see https://www.youtube.com/watch?v=LT0a--DNJhI (but the quality of the pre-recorded part is not as good there). Regarding features: I learned when implementing it for the IntelliJ plugin that the functionality can be grown incrementally. Users will provide feedback on early functionality. Ideally there is fast feedback (think earth-sky as described by the ZertoMQ community). For the IntelliJ plugin, @danhaywood picked "sky", shared his needs, did a lot of tests and provided valuable input that steered development. Adding to @Mogztter's thoughts: recognizing that an AsciiDoc file is part of a component by locating an Functionality could then be added bit by bit: Picking up attributes from the component descriptor, settings more Antora attributes, picking up page names for xrefs, etc. For the IntelliJ plugin I decided to imitate Antora's behavior by re-implementing some of the behavior, for example resolving includes and xrefs. I can show where I hooked into Asciidoctor to inject the necessary functionality. When growing functionality, some features targeted the editor for auto-completion and inspections, others targeted the preview. This week and next I'll have only time to comment on issues. From Sep 27 onwards I'm happy to join a synchronous communication (video call, etc.) |
Hi, it would be great to include 2 features from Antora to this plugin: extended syntax for include and image macros, basically ability to specify module. |
Native support for Antora would be a great addition to this plugin! |
some Antora support has been provided with this PR #580 |
For now the extension detects the antora.yml file and offers the user to activate the Antora support (#580). I am currently working on the following features:
|
When is a preview version planned? I would like to test this Antora feature. |
Co-authored-by: Guillaume Grossetie <[email protected]> Ref #434
Any progress has been done on this matter? Would definitely love to come back to VS Code, Antora support in WebStorm is the only thing holding me on this java monstrosity |
Yes, some work has been done in 3.x (pre-release) but we are still missing a lot of features. We can use this issue as a "meta issue" |
I am not seeing image resource ID resolution working in the current plug-in, even in the simplest case where the image is stored in the standard images directory in the current module: Antora build output: Is this supposed to be working? References to other modules in the current component or modules in other components also don't seem to work. (I was hoping to use this code as a model for getting include directives working.) |
Did you enable Antora support? What version are you using? |
3.1.5 with Antora support enabled. I also have allow-uri-read set in asciidoctorAttributes. |
Could you please share a repository where I can reproduce this issue? It's working fine on my projects. |
It's a private repo in a corporate environment. Do you have a test repo that you can share? That would let me identify if there were an issue with my system or environment. The demo Antora demo repo has no images. I need also to do an experiment -- we use LFS for binary data, and that may be the problem. |
Are you using Windows? Could you please toggle the Developer Tools and copy/paste what you see in the "Console" tab when you open your AsciiDoc file? |
It might be an issue with the directory name Something must be wrong in: asciidoctor-vscode/src/features/antora/antoraSupport.ts Lines 172 to 189 in 15b4562
|
Also, I have a bunch of other questions about the code: In order to support include directives for preview in the plug in, here's what I think is required:
In the "normal" Antora execution path, the module name to fs correspondences are presumably generated when the playbook file is processed. Specifically, any module references are going to be limited to modules found in sources declared in the playbook file. And of course they're not really file system references but git references, since they include branch information. Since the plugin code doesn't process playbooks, I assuming that we need specific code to search for modules in the workspace directory. I think this is what the IntelliJ plugin is doing. Can you give me any insights into where in the plugin code I should be looking? |
It says "Also Modified in Workspace", is it enabled on the workspace? |
Thanks for providing additional information. It seems that the extension correctly identifies that the AsciiDoc file is part of an Antora documentation component. For some unknown reason, I believe that the content catalog, which is built from the files in the workspace, does not contain the image, or it can't be found. I will see if it's possible to add trace or debug logs to facilitate analysis and troubleshooting. Are you using symbolic links or anything unusual on your file system? |
Also, could you try to use a different name for your documentation component (in If it still does not work, could you try to use a qualified Antora resource ID? |
If possible, I believe that it should render a broken image in that case instead of allowing the preview to find the adjacent one...because Antora won't find it there. If that's possible. |
No. The above tests were under Windows. The direcotory is just plain
Of course. Name changed from Let me know whenever you need further information, logs etc. |
One more note on The setup here was:
So, acutally I am not using workspaces really. If I explictly save everything as a workspace (file) it and load that, it doesn't fix the preview though either. |
Could you please disable the CSP using the command palette "Manage preview security settings"? |
👍 |
Done. Switched to "Disabled" and triggered preview refresh by some edits. The images are not shown though. |
Would you be able to share your workspace on GitHub (i.e, |
Of course! Repo Output of
|
Yay! I can finally reproduce it! 🎉 It does not work because |
The power of a proper MWE |
That's true, Minimal Non Working Example 😄 |
Sure...: I am happy to confirm that 3.1.10. fixes this issue! Now I am getting all images displayed in the preview. Thank you so much! This is really good news as a working image preview is crucial here for non-dev users. |
After a short hiatus concerning image insertion :-) I permit myself to ask for further tweaks when in antora mode: (1) As asked by @mojavelinux above:
In 3.1.10, images are still detected and previewed from the Especially because... (2) ... images pasted from the clipboard will be inserted into the |
@ggrossetie Thank you so much for this update. It also properly supports this functionality:
These were issues that I reported back in September. Antora's support for content reuse/single-sourcing through the include directive is a key feature, and supporting it in VS Code is a big win. Thanks again! |
The image preview does not work here when |
@m1027 Thanks for the follow-up, could you please open a specific issue for |
Could you please open a dedicated issue for that? |
I guess we should also open a new issue for this one 😉 |
Alright, I have created some new issues. |
as a workaround before antora is fully supported, I managed to preview images in vscode-asciidoctor web preview by doing the following setting in vscode web preview:
|
I stumbled upon the same issue, images located in the My minmal example is pretty much the same as this one: #434 (comment) I've read some issues including this one, and can't come to a conclusion whether images in the It's of major importance for our use case that image previews work, I can imagine we will look into the code and fix it, maybe someone can provide a few insights on the status of this feature? Same question for honoring the Additionally, I believe the effort in #855 is not going in the right direction, as this workaround only works if there are no sub-folders in which a page that references images is located. It would lead to a partially broken fix. |
It should work, did you enable Antora support on this workspace? |
Yesterday, 2021-08-22 I learned about Antora at FrOSCon 2021. It was presented by the developer of the IntelliJ Asciidoctor Plugin.
While I'm not yet using Asciidoctor, I only learned about it a day ago ;), It sounds quite promising and useful, what he presented. Unfortunately there is no recording available yet.
Features
workspace
antora.yml
antora.yml
files in the workspace and ask user if they want to enable Antora supportsite-manifest.json
Preview
antora.yml
in the preview #691image
resource IDs in the previewinclude
resource IDs in the previewxref
resource IDs in the previewNavigate
image:2.0@cli:commands:seaswell.png[]
) #692xref:module:filename.adoc[]
)include::include::ROOT:partial$treeline-warning.adoc[]
)Auto-completion
Suggestions/actions
image:seaswell.png[]
toimage:2.0@cli:commands:seaswell.png[]
)image:2.0@cli:commands:seaswell.png
toimage:seaswell.png[]
if the image is referenced in the same component/module/version)The text was updated successfully, but these errors were encountered: