asciidoctor / asciidoctor-diagram

:left_right_arrow: Asciidoctor diagram extension, with support for AsciiToSVG, BlockDiag (BlockDiag, SeqDiag, ActDiag, NwDiag), Ditaa, Erd, GraphViz, Mermaid, Msc, PlantUML, Shaape, SvgBob, Syntrax, UMLet, Vega, Vega-Lite and WaveDrom.
http://asciidoctor.org
MIT License
431 stars 106 forks source link

D2: TALA license works with macro but not blocks #425

Closed ArwynFr closed 9 months ago

ArwynFr commented 11 months ago

I'm using some D2 diagrams with TALA layout. I've added the TSTRUCT_TOKEN environment variable.

The following adoc works:

d2::diagrams/4-topology-client.d2[layout=tala, format=png]

This one produces the diagram with the unlicensed overlay:

[d2, layout=tala, format=png]
----
include::diagrams/4-topology-client.d2[]
----
pepijnve commented 11 months ago

That's rather surprising. Regardless of the form (block or macro) the invocation of d2 ends up exactly the same.

Would you mind confirming this by running with the --verbose flag? I would expect you to see the exact same output for both forms.

pepijnve commented 11 months ago

I tried reproducing the problem you're seeing locally, but it works as expected for me (on macOS). I tried both of these variants and both worked fine.

export TSTRUCT_TOKEN=...
asciidoctor -r asciidoctor-diagram...

and

TSTRUCT_TOKEN=... asciidoctor -r asciidoctor-diagram...
ArwynFr commented 11 months ago

I'm on Windows 10 1809 ; the command I'm running is through asciidoc-pdf:

asciidoctor-pdf --require asciidoctor-diagram --attribute pdf-theme=xxx --attribute pdf-themesdir=xxx\themes --attribute pdf-fontsdir=xxx\themes\fonts --attribute imagesoutdir=xxx\Temp --source-dir .\test\ --destination-dir . **/*.adoc

Versions:

d2 v0.5.1
Asciidoctor PDF 2.3.5 using Asciidoctor 2.0.18 [https://asciidoctor.org]
Runtime Environment (ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x64-mingw-ucrt]) (lc:CP850 fs:UTF-8 in:UTF-8 ex:UTF-8)

At first I added the TSTRUCT_TOKEN environment variable in the current context ($env:TSTRUCT_TOKEN = 'xxx'). After I added the environment variable in the user's environment varaibles dialog and restarted the computer it's working now. I will try to remove the env varaible from there and reproduce with a simpler case.

pepijnve commented 9 months ago

Closing for now since this was not reproducible and no further information was provided