Login  Register

Re: How can I convert relative image paths to absolute paths when I convert asciidoctor to html5?

Posted by David Jencks on Feb 16, 2020; 6:16am
URL: https://discuss.asciidoctor.org/How-can-I-convert-relative-image-paths-to-absolute-paths-when-I-convert-asciidoctor-to-html5-tp7651p7654.html

That’s a nice idea!  Do you have emacs understanding asciidoc?  Until recently I was using emacs exclusively for asciidoc, but without any syntax help.

I don’t know how to make asciidoctor generate absolute paths, but i wonder if you could symlink your imagedir to the appropriate relative location to where the preview is?

thanks
David Jencks

On Feb 15, 2020, at 9:29 PM, egalitarian [via Asciidoctor :: Discussion] <[hidden email]> wrote:

This is what I currently do in emacs.

(bind-key "C-x c"
          (lambda ()
            (interactive)
            (call-process "asciidoctor" nil nil nil
                          "-a" "data-uri" "-o" "/tmp/adoc-preview.html"
                          (buffer-file-name))))
(bind-key "C-x p"
          (lambda ()
            (interactive)
            (call-process "qutebrowser" nil 0 nil
                          "/tmp/adoc-preview.html")))

C-x c is mapped to converting the current file into /tmp/adoc-preview.html with data-uri.
C-x p executes "qutebrowser /tmp/adoc-preview.html".

If data-uri can be omitted, conversion would become faster. This is used for semi-automatic live preview.


To start a new topic under Asciidoctor :: Discussion, [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML