flobilosaurus / vscode-asciidoc-slides

Visual Studio Code extension to create reveal.js slides via asciidoc
MIT License
25 stars 10 forks source link

include not working? #16

Closed anb0s closed 4 years ago

anb0s commented 4 years ago

Thanks for the nice plugin!

I'm using include in my AsciiDoc documents for "separation of concerns". All general attributes are shared between all presentations (slides) in a file attributes.adoc and first included before the content begins. After the chapters are included from defined {includedir} folder etc.

presentation.adoc:

//  general attributes like {includedir}, {imagedir}, servers (plantuml, kroki)
include::attributes.adoc[]

// first slide: topic, autor, version, date etc.
= Presentation
...

// chapters located in {includedir}
include::{includedir}/overview.adoc[]
include::{includedir}/my_first_chapter.adoc[]
...

With asciidoctor-reveal.js, asciidoctor etc. it works.

The preview of the plugin does not show the right content as includes are not resolved.

flobilosaurus commented 4 years ago

I have looked into it and found the bug. Working on a fix...

flobilosaurus commented 4 years ago

https://github.com/flobilosaurus/vscode-asciidoc-slides/commit/1f379f1a793b9c82e7a74396e9997fb7c924e65b enables includes. I have just released version 1.2.0 of extension, which includes this fix.

anb0s commented 4 years ago

Thank You! Now it works for the main document if the included file is located in same or sub-directory where the main document is --> main problem solved!

But there is an issue if it points to parent directory (e.g. .. ) in case of "chapters" files.

attributes.adoc:

// --- directories ---
ifndef::parentdocroot[]
:parentdocroot: ..
endif::parentdocroot[]
:imagesdir: {parentdocroot}/images
:includedir: {parentdocroot}/chapters

So it does not include and also images are also not shown. I do not know if it can also be handled...

flenalio commented 1 year ago

Hi o/ I'm using AsciiDoc Slides v1.3.0, vscode 1.74.3 on Linux and

include::../render/header-slides.adoc[]

= Title

Is broken :-S

Unresolved directive in \<stdin> - include::../render/header-slides.adoc[]

No problem with this code in asciidoctor-revealjs