[pmg-devel] applied: [PATCH docs] add big attribute to thumbnails

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Nov 20 09:17:14 CET 2019


allows one to easily define bigger thumbnails, i.e., those where we
have to big images to show the full on a page, but still want to give
the user a good sized preview.

As PDF renders this already pretty nice by default we only have to
adapt the html asciidoc config. We do that by using asciidocs
"Conditional Attribute References"[0] and add a "big" attribute.

It can be used as:
> [thumbnail="pmg-gui-network-config.png", big=1]

NOTE: the value of big is ignored, it just matters if it's defined.
While it could be possible to add logic to handle big=0, it it's just
extra work without real use, just omit it if not wanted.

[0]: https://www.methods.co.nz/asciidoc/chunked/ch30.html

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 asciidoc/pmg-html.conf | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/asciidoc/pmg-html.conf b/asciidoc/pmg-html.conf
index 74e0d13..75cc9a4 100644
--- a/asciidoc/pmg-html.conf
+++ b/asciidoc/pmg-html.conf
@@ -303,10 +303,13 @@ endif::deprecated-quotes[]
 [paragraph]
 <div class="paragraph{role? {role}}{unbreakable-option? unbreakable}"{id? id="{id}"}>
 {thumbnail#}<a class="image" href="images/screenshot/{thumbnail}">
-{thumbnail#}<img src="images/screenshot/{thumbnail}" alt="{alt={thumbnail}}" width=250
+{thumbnail#}<img src="images/screenshot/{thumbnail}" alt="{alt={thumbnail}}"
+{thumbnail#}{width#}width="{width}"
+{thumbnail#}{big#}{width%}width="800"
+{thumbnail#}{big%}{width%}width="250"
 {thumbnail#}{float at left: style="padding\: 0 10px 0 0;float\:left;"}
 {thumbnail#}{float at right: style="padding\: 0 0 0 10px;float\:right;"}
-{thumbnail#}{float%} style="padding: 0 0 0 10px;float:right;"
+{thumbnail#}{big%}{float%} style="padding: 0 0 0 10px;float:right;"
 {thumbnail#}></a>
 {title?<div class="title">{title}</div>}<p>
 |
-- 
2.20.1




More information about the pmg-devel mailing list