Publishing helper scripts for image handling and cross-referencing

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Publishing helper scripts for image handling and cross-referencing

ghorwin
Hi there,

just wanted to let you know that I have written two helper scripts that assist with getting good quality publications based on Asciidoc-texts. The stuff is here:

https://github.com/ghorwin/asciidoctor-publishing

In a nutshell:

- html output and pdf output may need different images (html resized, pdf max resoluation); since asciidoctor-syntax does not allow specifying target-format-specific image file names, the script can be used to toggle a set of adoc files from html to pdf mode and vice-versa (basically in-place replacing file names)

- cross-referencing in large, multi-adoc-file documents can be tricky, even with good editors such as AsciiDocFX. The second script parses all adoc files in a directory and a) dumps out a list of cross-ref-labels (only manually created labels, so far) and also checks for duplicates and invalid label strings; and b) checks all cross-references in the text if the referenced labels exist - in case of error, filename and line number are printed out for easy fixing.

Hope that helps you - it helps me at least

-Andreas
Reply | Threaded
Open this post in threaded view
|

Re: Publishing helper scripts for image handling and cross-referencing

abelsromero
I see you mention requiring manual resizing of images. Have you considered using https://imagemagick.org/index.php to automate it?
Reply | Threaded
Open this post in threaded view
|

Re: Publishing helper scripts for image handling and cross-referencing

ghorwin
Yup, imagemagick works good, too.

One possible way to further automate the process would be to just store the 'yyy-print.png' variant, and in case that the width=xxx option passed to the image tag is not matching the native yyy-print.png image's resolution, fire up imagemagick and generate the corresponding smaller-size image on the fly. This would indeed simplify the screenshot update procedure.

Doing it manually has the advantage of having visual feedback and control over the resized image. Depending on the image type and content, sometimes resizing by 75% or 50% gives better quality than some weird percentage that might be obtained by fixing the target dimension.

-Andreas