asciidoctor-ldl 0.1.0 → 0.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d37e7971f951167055c3491ecfeb5490b04b57871428bedb4cdd9e1184ddda18
4
- data.tar.gz: 66950750f09e748e71f498678f0d305beb92ce31b04e8aa5cb2a47bc0f344069
3
+ metadata.gz: 719e75b23cf670612dd2d6248301fdb0e9cf5f4ed4de0a5a8cd4f4f09c05d07d
4
+ data.tar.gz: 4796262bbe18bf6029bff035d8552fdb4436e3990bd6bb571dcf7974bef27293
5
5
  SHA512:
6
- metadata.gz: 5bb1d501146cece951dbc5268ec36d73b058af6aceaaf3124bef4c870594fbc7cac86041f5b6fa342b18b3ba4037e3cc07ccb21f3d7ec52f9c23bc34eb623dd3
7
- data.tar.gz: a07923b23d094eabfff664acf3d95b4451802e5c3263616eba076cbd11b86b71d32baedbec57fdf5f552f7a897f677431431e7145eefe0e515953fd555cbd674
6
+ metadata.gz: 7a2d2626dc179498d8e3bc634eaef11f9398456f112bed6839ed227ed96266becb34dff4d55581f6c2835541c036f7302526019ee4ab1af6c4c96865fddd8082
7
+ data.tar.gz: e1725021eed0b25fa9a8605399f935a63e7f3164902f0fc354b19cbab6774c91a14039fb23b2380ef9370605c75534c263138df204fa9994e88c1a1cc71f2698
data/CHANGELOG.md CHANGED
@@ -6,6 +6,14 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.1.1] - 2026-07-23
10
+
11
+ ### Added
12
+
13
+ - Pass the `pdfwidth` and `scaledwidth` image attributes through to the
14
+ generated image, so diagram size can be controlled in asciidoctor-pdf (and
15
+ `scaledwidth`/`width` elsewhere). Also forwards `window`, `opts` and `fit`.
16
+
9
17
  ## [0.1.0] - 2026-07-23
10
18
 
11
19
  ### Added
@@ -23,5 +31,6 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
23
31
  - Content-addressed caching with a digest sidecar so unchanged diagrams are not
24
32
  re-rendered.
25
33
 
26
- [Unreleased]: https://github.com/OpenPowerShift/asciidoctor-ldl/compare/v0.1.0...HEAD
34
+ [Unreleased]: https://github.com/OpenPowerShift/asciidoctor-ldl/compare/v0.1.1...HEAD
35
+ [0.1.1]: https://github.com/OpenPowerShift/asciidoctor-ldl/compare/v0.1.0...v0.1.1
27
36
  [0.1.0]: https://github.com/OpenPowerShift/asciidoctor-ldl/releases/tag/v0.1.0
data/README.adoc CHANGED
@@ -204,8 +204,18 @@ header or on the command line (`-a ldl-format=png`).
204
204
  | Set to `false` to always re-render, ignoring the cache.
205
205
  |===
206
206
 
207
- Standard image attributes — `alt`, `title`, `width`, `height`, `align`,
208
- `float`, `id`, `link`, `role` — pass straight through to the generated image.
207
+ Standard image attributes — `alt`, `title`, `width`, `height`, `pdfwidth`,
208
+ `scaledwidth`, `align`, `float`, `id`, `link`, `role` — pass straight through to
209
+ the generated image. To control the rendered size, use `width` for HTML and
210
+ `pdfwidth` (or `scaledwidth`) for `asciidoctor-pdf`, e.g.:
211
+
212
+ [source]
213
+ ----
214
+ ldl::diagrams/trip.ldl[pdfwidth=80%]
215
+ ----
216
+
217
+ Without a sizing attribute, a diagram renders at its intrinsic size and
218
+ `asciidoctor-pdf` scales an over-wide one down to the content width.
209
219
 
210
220
  TIP: Most *diagram* styling (inversion bubbles vs NOT gates, input bars,
211
221
  compactness, stroke width, margins, …) is authored in the LDL source itself with
@@ -78,9 +78,17 @@ module Asciidoctor
78
78
  (images_dir && !images_dir.to_s.empty?) ? File.join(base, images_dir) : base
79
79
  end
80
80
 
81
+ # Image attributes passed straight through to the generated image block.
82
+ # Includes the sizing attributes for every backend: +width+ (HTML),
83
+ # +pdfwidth+/+scaledwidth+ (asciidoctor-pdf).
84
+ IMAGE_PASSTHROUGH = %w[
85
+ alt title width height pdfwidth scaledwidth align float id link
86
+ window opts fit
87
+ ].freeze
88
+
81
89
  def create_ldl_image(parent, attrs, filename, renderer, _doc)
82
90
  image_attrs = { 'target' => filename }
83
- %w[alt title width height align float id link].each do |key|
91
+ IMAGE_PASSTHROUGH.each do |key|
84
92
  image_attrs[key] = attrs[key] if attrs.key?(key)
85
93
  end
86
94
  image_attrs['alt'] ||= (attrs['target'] || 'LDL logic diagram')
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Asciidoctor
4
4
  module Ldl
5
- VERSION = '0.1.0'
5
+ VERSION = '0.1.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-ldl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Mulholland