Skip to content

Commit a208004

Browse files
authored
diagram-generator: Support passing width and height in a block
Closes: #242
1 parent af7777e commit a208004

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

diagram-generator/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ set to the absolute path of `java.exe` e.g.
3636
Example usage:
3737

3838
~~~~~~~~~~~~~~~~
39-
```{.plantuml caption="This is an image, created by **PlantUML**."}
39+
```{.plantuml caption="This is an image, created by **PlantUML**." width=50%}
4040
@startuml
4141
Alice -> Bob: Authentication Request Bob --> Alice: Authentication Response
4242
Alice -> Bob: Another authentication Request Alice <-- Bob: another Response

diagram-generator/diagram-generator.lua

+4-2
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ function CodeBlock(block)
361361
local title = #caption > 0 and "fig:" or ""
362362

363363
-- Transfer identifier and other relevant attributes from the code
364-
-- block to the image. Currently, only `name` is kept as an attribute.
364+
-- block to the image. The `name` is kept as an attribute.
365365
-- This allows a figure block starting with:
366366
--
367367
-- ```{#fig:example .plantuml caption="Image created by **PlantUML**."}
@@ -370,7 +370,9 @@ function CodeBlock(block)
370370
-- with `pandoc-crossref`.
371371
local img_attr = {
372372
id = block.identifier,
373-
name = block.attributes.name
373+
name = block.attributes.name,
374+
width = block.attributes.width,
375+
height = block.attributes.height
374376
}
375377

376378
-- Create a new image for the document's structure. Attach the user's

diagram-generator/sample.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ set to the absolute path of `java.exe` e.g.
3535

3636
Example usage:
3737

38-
```{.plantuml caption="This is an image, created by **PlantUML**."}
38+
```{.plantuml caption="This is an image, created by **PlantUML**." width=50%}
3939
@startuml
4040
Alice -> Bob: Authentication Request Bob --> Alice: Authentication Response
4141
Alice -> Bob: Another authentication Request Alice <-- Bob: another Response

0 commit comments

Comments
 (0)