asciidoctor / asciidoctor-kroki

Asciidoctor.js extension to convert diagrams to images using Kroki!

Home Page:https://kroki.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Output directory not honoring value of :to_dir option

mojavelinux opened this issue · comments

To be consistent with the behavior of Asciidoctor Diagram, when the imagesoutdir attribute is not specified, Asciidoctor Kroki should save images to the imagesdir folder relative to the output directory of the processor (the directory where the output file is being written). In code, the location of the output directory can be expressed as:

(doc.attr 'outdir') || (doc.nested? ? doc.parent_document : doc).options[:to_dir]

This uses the value of outdir, if set, falling back to the :to_dir option if it's not set.

Currently, Asciidoctor Kroki is instead looking for the to_dir attribute:

elsif (to_dir = doc.attr('to_dir'))

to_dir is not a recognized built-in attribute name in Asciidoctor. Therefore, I think this code is incorrect.