question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[kroki-fetch-diagram] generated-file-name parameter not used

See original GitHub issue

see #47 for my setup

My test presentation.adoc sets the imagesdir and use generated-file-name parameter to have all images with human readable names:

ifndef::imagesdir[:imagesdir: ./images]

== UML class diagram test with kroki
[plantuml, "diagram-classes", svg]
....
class BlockProcessor
class DiagramBlock
class DitaaBlock
class PlantUmlBlock

BlockProcessor <|-- DiagramBlock
DiagramBlock <|-- DitaaBlock
DiagramBlock <|-- PlantUmlBlock
....

It fetches the diagram and writes to images/210a0ebf2a7bb40669c4e3c895b2c9396f048327.svg instead of images/diagram-classes.svg like ascidoctor-diagram does.

It would be good to support the mandatory diagram parameters from asciidoctor-diagram.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:17 (17 by maintainers)

github_iconTop GitHub Comments

2reactions
Mogzttercommented, Jun 5, 2022

To achieve that goal, I propose using the diagram name specified on the block as the filename prefix in place of diag (e.g., diagram-name-cf699e6a13a1976b55764d80b6f9d508.png).

That’s a good idea! I wonder if it exists a better (shorter) hashing algorithm to make the filename more human-friendly? I did a quick search but I couldn’t find a good alternative.

That makes the filename recognizable while still including the hash to serve as the cache key and to prevent filename conflicts. wdyt?

I agree, let’s do that 👍🏻

1reaction
mojavelinuxcommented, Jun 4, 2022

The linked PR is closed, however this issue is still open. In my trials (using the RubyGem), it appears that the custom / human-readable name is still ignored (https://github.com/Mogztter/asciidoctor-kroki/blob/master/ruby/lib/asciidoctor/extensions/asciidoctor_kroki/extension.rb#L291). Is that accurate? If so, is the plan still to support the custom name, or is there a reason for always using the auto-generated name?

I’d be glad to help get this resolved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuration - Kroki Documentation
Diagram Binary Paths​​ Kroki depends on external binaries to generate images. By default, Kroki will locate these binaries in the PATH environment variable....
Read more >
AsciiDoc Diagram (#31818) · Issues - GitLab.org
Resolution At this point we're using Kroki to support additional diagram types - we won't be supporting asciidoctor-diagram directly.
Read more >
The Chart Template Developer's Guide - Helm V2
Templates generate manifest files, which are YAML-formatted resource descriptions that Kubernetes can understand. We'll look at how templates are structured, ...
Read more >
GitLab Arbitrary File Read & Write through Kroki - CVE-2021 ...
generate_data_uri makes call to File.binread which is reading file at the path specified in the target_image parameter. ::File.
Read more >
Asciidoctor Diagram
The second, optional positional attribute assigns a file name (i.e. target ) to the generated diagram. If a target is not specified an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found