@inditextech/docouture-cli 0.1.0-SNAPSHOT.82.1 → 0.1.0-SNAPSHOT.85.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -145,7 +145,7 @@ asciidoc:
145
145
  page-pagination: '@'
146
146
  # Same as the real antora-playbook.yml — see its own comment.
147
147
  kroki-enabled: true
148
- kroki-diagram-types: mermaid,plantuml,bpmn,excalidraw
148
+ kroki-diagram-types: mermaid,plantuml,bpmn,excalidraw,structurizr
149
149
  extensions:
150
150
  # Authoring blocks with no plain AsciiDoc equivalent — [tabs], [cards],
151
151
  # [feature-tabs], [cta], [accordion] grouping, plus the label:[]/mono:[]
@@ -165,10 +165,10 @@ asciidoc:
165
165
  # diagram type, ...); `docouture teardown kroki` stops it manually, since
166
166
  # nothing stops it automatically. `kroki-diagram-types` is a
167
167
  # comma-separated subset of kroki.js's `SUPPORTED_TYPES` (e.g. `mermaid`
168
- # or `mermaid,plantuml,bpmn,excalidraw`); omit it to enable every
169
- # supported type.
168
+ # or `mermaid,plantuml,bpmn,excalidraw,structurizr`); omit it to enable
169
+ # every supported type.
170
170
  kroki-enabled: true
171
- kroki-diagram-types: mermaid,plantuml,bpmn,excalidraw
171
+ kroki-diagram-types: mermaid,plantuml,bpmn,excalidraw,structurizr
172
172
  extensions:
173
173
  # Authoring blocks with no plain AsciiDoc equivalent — [tabs], [cards],
174
174
  # [feature-tabs], [cta], [accordion] grouping, plus the label:[]/mono:[]
@@ -96,6 +96,9 @@ fragment: xref:main:getting-started.adoc#add-a-page[a specific section on that p
96
96
  .A block image, capped at its own natural size
97
97
  image::ROOT:hero-placeholder.png[A placeholder image,480]
98
98
 
99
+ .The same image, marked `role=zoom-in` — click it for a bigger, fullscreen view (GH-197)
100
+ image::ROOT:hero-placeholder.png[A placeholder image,480,role=zoom-in]
101
+
99
102
  An inline image sits mid-paragraph: image:ROOT:card-placeholder.png[A small inline
100
103
  placeholder,20,20] like so. Font icons, keyboard shortcuts and UI paths:
101
104
  icon:check[] done, kbd:[Ctrl+C] to copy, btn:[Save] to save, menu:File[Save As] to open
@@ -434,10 +437,11 @@ xref:main:getting-started.adoc[Get started]
434
437
 
435
438
  === Diagrams
436
439
 
437
- `[mermaid]`, `[plantuml]`, `[graphviz]` and a handful of other diagram languages (see
438
- `@inditextech/docouture-asciidoc-extensions`' `lib/kroki-config.js` for the full list) render
439
- as real diagrams via a self-hosted https://kroki.io[Kroki] service — a literal block
440
- (four dots, not a fenced code block) styled with the diagram language's name:
440
+ `[mermaid]`, `[plantuml]`, `[graphviz]` and over a dozen more diagram languages (see
441
+ `@inditextech/docouture-asciidoc-extensions`' `lib/kroki-config.js` for the full,
442
+ live-verified list) render as real diagrams via a self-hosted https://kroki.io[Kroki]
443
+ service — a literal block (four dots, not a fenced code block) styled with the diagram
444
+ language's name:
441
445
 
442
446
  [,asciidoc]
443
447
  ----
@@ -467,26 +471,97 @@ definition, or comment the two attributes back out to turn the feature off entir
467
471
  block like the one above then renders exactly as plain AsciiDoc already would: the raw
468
472
  diagram source, as literal text, same as the fenced listing shows it above.
469
473
 
474
+ ==== Positional shorthand and diagram-specific options
475
+
476
+ The classic asciidoctor-diagram/asciidoctor-kroki `[type,target,format]` positional
477
+ form works alongside the named `format=` attribute already shown above — the second
478
+ comma-separated value is a `target` (accepted but otherwise unused: this extension
479
+ always inlines, never writes a named file to disk), the third is the `format`:
480
+
481
+ [,asciidoc]
482
+ ----
483
+ [plantuml,connectivity-flow,png]
484
+ ....
485
+ Alice -> Bob : request
486
+ Bob --> Alice : response
487
+ ....
488
+ ----
489
+
490
+ [plantuml,connectivity-flow,png]
491
+ ....
492
+ Alice -> Bob : request
493
+ Bob --> Alice : response
494
+ ....
495
+
496
+ Any named attribute beyond the built-in set (`target`, `width`, `height`, `format`,
497
+ `role`, `title`, `caption`, …) is a Kroki diagram-specific option, forwarded to Kroki as
498
+ a `Kroki-Diagram-Options-<key>` HTTP header — exactly as the real asciidoctor-kroki
499
+ extension forwards them. Structurizr's `view-key` selects which view of a
500
+ multi-view workspace to render:
501
+
502
+ [,asciidoc]
503
+ ----
504
+ [structurizr,view-key=SystemContext]
505
+ ....
506
+ workspace {
507
+ model {
508
+ user = person "User"
509
+ system = softwareSystem "Software System"
510
+ user -> system "Uses"
511
+ }
512
+ views {
513
+ systemContext system "SystemContext" {
514
+ include *
515
+ autoLayout
516
+ }
517
+ }
518
+ }
519
+ ....
520
+ ----
521
+
522
+ [structurizr,view-key=SystemContext]
523
+ ....
524
+ workspace {
525
+ model {
526
+ user = person "User"
527
+ system = softwareSystem "Software System"
528
+ user -> system "Uses"
529
+ }
530
+ views {
531
+ systemContext system "SystemContext" {
532
+ include *
533
+ autoLayout
534
+ }
535
+ }
536
+ }
537
+ ....
538
+
470
539
  ==== Styling
471
540
 
472
541
  Mermaid diagrams are themed to match this site automatically — square
473
- corners, black-on-white (light mode; inverted for dark), body typography — via a
474
- `%%{init: {...}}%%` directive this extension prepends to the diagram's own source
475
- before it ever reaches Kroki, not via CSS. Write your own `%%{init...}%%` as the
476
- diagram's first line to opt out and take full control of Mermaid's own theming instead.
477
- Every other diagram type's font is still normalized via CSS (safe — a tool's typeface
478
- choice carries no meaning); BPMN's two-tone palette is still remapped via CSS too
479
- (its bpmn-js renderer has no source-level theming hook this package uses yet, unlike
480
- Mermaid's). BPMN's own rounded task-box corners could not be un-rounded by any means
481
- found — bpmn-js hardcodes that radius; this is a real, currently-unfixed limitation,
482
- not an oversight.
483
-
484
- ==== PNG output
485
-
486
- `[mermaid,format=png]` (or any other diagram language Kroki can rasterize — see
487
- `kroki-config.js`'s `PNG_SUPPORTED_TYPES` for the full list; `bpmn` and `excalidraw`
488
- are notably **not** on it, Kroki itself rejects `/bpmn/png` and `/excalidraw/png`
489
- outright) renders a transparent PNG instead of inline SVG:
542
+ corners, black-on-white, body typography — via a `%%{init: {...}}%%` directive this
543
+ extension prepends to the diagram's own source before it ever reaches Kroki, not via
544
+ CSS. Write your own `%%{init...}%%` as the diagram's first line to opt out and take
545
+ full control of Mermaid's own theming instead. Every other diagram type's font is
546
+ still normalized via CSS (safe — a tool's typeface choice carries no meaning). BPMN's
547
+ own rounded task-box corners could not be un-rounded by any means found — bpmn-js
548
+ hardcodes that radius; this is a real, currently-unfixed limitation, not an oversight.
549
+
550
+ The card framing a diagram follows this site's own light/dark theme, same as any other
551
+ card — but the diagram's own canvas underneath it is always a fixed white, regardless of
552
+ theme: diagram tools don't agree on whether they draw a background at all (GraphViz
553
+ bakes its own opaque white one; Mermaid and PlantUML bake none), so a fixed canvas is
554
+ what makes every diagram read the same rather than depending on that inconsistency —
555
+ and it means a diagram's own colors never need inverting for dark mode, avoiding the
556
+ distortion that would cause for anything genuinely colorful (a PlantUML `skinparam`
557
+ palette, a Structurizr diagram's own color-coded boxes, an Excalidraw scene).
558
+
559
+ ==== Output formats
560
+
561
+ `[mermaid,format=png]` (or any other diagram language and format Kroki's own server
562
+ accepts for it — see `kroki-config.js`'s `FORMAT_SUPPORT` for the exact, live-verified
563
+ matrix; it varies per type, not a blanket rule) renders a raster image instead of
564
+ inline SVG:
490
565
 
491
566
  [,asciidoc]
492
567
  ----
@@ -511,9 +586,29 @@ Embedded as a plain `<img>` with a base64 `data:` URI — no extra file written,
511
586
  HTTP request. Reach for this only when you actually need a raster image (an export, an
512
587
  email, a renderer that can't handle inline SVG); the inline-SVG default stays sharper at
513
588
  every zoom level and lets a reader select/search the diagram's own text, neither of
514
- which a PNG can do. An unsupported type or a typo'd `format=` value both fall back to
515
- `svg` with a build warning, the same degrade-not-fail posture as an unknown
516
- `kroki-diagram-types` entry.
589
+ which a raster format can do. Beyond `png`: `jpeg` (`jpg` also accepted), `pdf`
590
+ (embedded as an `<embed>`, since a browser can't display a PDF through `<img>`) and
591
+ `base64` all render the same way. An unsupported type/format combination, or a typo'd
592
+ `format=` value, falls back to `svg` with a build warning, the same degrade-not-fail
593
+ posture as an unknown `kroki-diagram-types` entry.
594
+
595
+ `txt`/`atxt`/`utxt` are different in kind, not just encoding — Kroki renders these as a
596
+ literal ASCII-art-style text representation, not an image at all:
597
+
598
+ [,asciidoc]
599
+ ----
600
+ [plantuml,format=txt]
601
+ ....
602
+ Alice -> Bob : request
603
+ Bob --> Alice : response
604
+ ....
605
+ ----
606
+
607
+ [plantuml,format=txt]
608
+ ....
609
+ Alice -> Bob : request
610
+ Bob --> Alice : response
611
+ ....
517
612
 
518
613
  ==== BPMN
519
614
 
@@ -672,10 +767,39 @@ includes an `excalidraw` service alongside `mermaid` for exactly that reason:
672
767
  "fontSize": 20,
673
768
  "seed": 2
674
769
  }
675
- ]
770
+ ]
676
771
  }
677
772
  ....
678
773
 
774
+ ==== Zoom
775
+
776
+ Any diagram (or, per the "Images and icons" section above, any plain `image::` block)
777
+ marked `role=zoom-in` gets a click-to-zoom affordance: a `zoom-in` cursor and a subtle
778
+ hover tint for a mouse, a small persistent badge for touch, and clicking/tapping opens
779
+ a fullscreen overlay with a bigger view — Esc, the close icon, or the backdrop all
780
+ dismiss it:
781
+
782
+ [,asciidoc]
783
+ ----
784
+ [mermaid,role=zoom-in]
785
+ ....
786
+ stateDiagram-v2
787
+ [*] --> Idle
788
+ Idle --> Running : start
789
+ Running --> Idle : stop
790
+ ....
791
+ ----
792
+
793
+ [mermaid,role=zoom-in]
794
+ ....
795
+ stateDiagram-v2
796
+ [*] --> Idle
797
+ Idle --> Running : start
798
+ Running --> Idle : stop
799
+ ....
800
+
801
+ Static, no pan/pinch-zoom — a bigger, still image, not an image viewer.
802
+
679
803
  === Inline macros: `label:` and `mono:`
680
804
 
681
805
  label:grey[Default] label:red[Blocked] label:orange[Pending] label:green[Stable]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inditextech/docouture-cli",
3
- "version": "0.1.0-SNAPSHOT.82.1",
3
+ "version": "0.1.0-SNAPSHOT.85.1",
4
4
  "description": "Command-line tool for docouture documentation sites: scaffold a new site and set its Antora version outside the monorepo",
5
5
  "repository": {
6
6
  "type": "git",