From 04a0fd7b783eddc8f6540cb24f0fc8d94bde1eff Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Mon, 14 Sep 2020 18:35:25 -0700 Subject: [PATCH] doc: wikiparser: Show icons with full size Setting the height to 26 in the XML file results in HTML getting a 16px size. 16x16 is original size of all the icons. This was first proposed with a size of 20 in the original wikiparser MR. Tests: - Affected sections/pages of the manual are: Firewall, Hardware and VirtualBox. Confirm by diffing with manual generated without the code changes. - Open all affected pages and the full manual page and confirm that images sizes are 16px (original size). - Check all affected pages and the full manual page in FreedomBox interface and confirm that images sizes are 16px (original size). - Check all affected sections in the generated PDF. - Repeat tests for English and Spanish manuals. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- doc/scripts/wikiparser.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/scripts/wikiparser.py b/doc/scripts/wikiparser.py index 17a7aeccb..d723264a5 100755 --- a/doc/scripts/wikiparser.py +++ b/doc/scripts/wikiparser.py @@ -741,7 +741,7 @@ def parse_text(line, context=None, parse_links=True): target = f'{ICONS_DIR}/{WIKI_ICONS[line.strip()]}.png' result.append( EmbeddedAttachment(target, [PlainText(icon_text)], - 'depth=16,width=16')) + 'height=26')) line = line.lstrip().replace(icon_text, '', 1) break @@ -1079,22 +1079,22 @@ PlainText(' ')])] >>> parse_wiki('/!\\\\') [Paragraph([EmbeddedAttachment('icons/alert.png', \ -[PlainText('/!\\\\')], 'depth=16,width=16'), PlainText(' ')])] +[PlainText('/!\\\\')], 'height=26'), PlainText(' ')])] >>> parse_wiki('(./)') [Paragraph([EmbeddedAttachment('icons/checkmark.png', \ -[PlainText('(./)')], 'depth=16,width=16'), PlainText(' ')])] +[PlainText('(./)')], 'height=26'), PlainText(' ')])] >>> parse_wiki('{X}') [Paragraph([EmbeddedAttachment('icons/icon-error.png', \ -[PlainText('{X}')], 'depth=16,width=16'), PlainText(' ')])] +[PlainText('{X}')], 'height=26'), PlainText(' ')])] >>> parse_wiki('{i}') [Paragraph([EmbeddedAttachment('icons/icon-info.png', \ -[PlainText('{i}')], 'depth=16,width=16'), PlainText(' ')])] +[PlainText('{i}')], 'height=26'), PlainText(' ')])] >>> parse_wiki('{o}') [Paragraph([EmbeddedAttachment('icons/star_off.png', \ -[PlainText('{o}')], 'depth=16,width=16'), PlainText(' ')])] +[PlainText('{o}')], 'height=26'), PlainText(' ')])] >>> parse_wiki('{*}') [Paragraph([EmbeddedAttachment('icons/star_on.png', \ -[PlainText('{*}')], 'depth=16,width=16'), PlainText(' ')])] +[PlainText('{*}')], 'height=26'), PlainText(' ')])] >>> parse_wiki('{{attachment:cockpit-enable.png}}') [Paragraph([EmbeddedAttachment('cockpit-enable.png', \