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 <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2020-09-15 15:23:27 -04:00
1 parent 57c60d9ac6
commit 04a0fd7b78
1 file changed
+7 -7
+7 -7
View File
@@ -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', \