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 +4 -4
- data/CHANGELOG.md +10 -1
- data/README.adoc +12 -2
- data/lib/asciidoctor/ldl/extension.rb +9 -1
- data/lib/asciidoctor/ldl/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 719e75b23cf670612dd2d6248301fdb0e9cf5f4ed4de0a5a8cd4f4f09c05d07d
|
|
4
|
+
data.tar.gz: 4796262bbe18bf6029bff035d8552fdb4436e3990bd6bb571dcf7974bef27293
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
|
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`, `
|
|
208
|
-
`float`, `id`, `link`, `role` — pass straight through to
|
|
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
|
-
|
|
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')
|