flobilosaurus / vscode-asciidoc-slides

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

export error in inline mode. #15

Closed matoken closed 4 years ago

matoken commented 4 years ago

Thank you for inline mode. It seems very convenient, but I get an error.

Error while exporting: The file /home/matoken/home/matoken/tmp/cat.png was not found!

Image from Gyazo

There is no problem in preview and html writing.

Slide example

:revealjs_theme: moon
:highlightjs-languages: asciidoc

= test slide

== hello

cat

image::cat.png[]

Environment VS Code 1.44.1-1586789296 or VSCodium 1.44.1-1586947591 + joaompinto.asciidoctor-vscode 2.7.15 + flobilosaurus.vscode-asciidoc-slides 1.1.0 OS : Debian sid amd64.

flobilosaurus commented 4 years ago

Is the path shown in your error message the exact location of the cat.png image?

matoken commented 4 years ago

No. The error is /home/matoken/home/matoken/tmp/cat.png , but the file exists in /home/matoken/tmp/cat.png.

$ pwd
/home/matoken/tmp
$ ls slide* cat.png 
cat.png  slide.adoc  slides.html  slidesInlined.html

I tried some.

image:cat.png[] -> /home/matoken/home/matoken/tmp/cat.png
image:./cat.png[] -> /home/matoken/home/matoken/tmp/cat.png
image:/home/matoken/tmp/cat.png[] -> /home/matoken/home/matoken/tmp/cat.png

image:~/tmp/cat.png[] -> /home/matoken/home/matoken/tmp/~/tmp/cat.png

flobilosaurus commented 4 years ago

I could neither reproduce your problem on a mac nor a windows machine. But i found another problem handling the given 'imagesdir' attribute in preview mode. Fixed it and published an update (version 1.1.1). Could you please test if i this update accidentally fixes your problem too? If not, is some folder in your used path (or the 'cat.png' image) a symlink or something similar ?

matoken commented 4 years ago

I tried using AsciiDoc Slides v1.1.1. Unfortunately there seems to be no change.

cat.png is a real file, not a symbolic link. Even if I replaced it with another image(dog.png), it did not change.

$ ls -l cat.png
-rw-r--r-- 1 matoken matoken 4072 Aug 11  2019 cat.png
$ convert pango:"<span font=\"/Library/Fonts/NotoColorEmoji\" size=\"24576\">🐶</span>" dog.png

However, I could export inline html by copying it under /tmp. It seems to work if it is higher than $HOME.

flobilosaurus commented 4 years ago

@matoken does version 1.2.0 of extension fix your issue?

matoken commented 4 years ago

I upgraded to 1.2.0 and tried it. It seems to be working. I was able to export a document below the home directory using inline html. Thank you very much. It's great!