Skip to content

Conversation

@kyselejsyrecek
Copy link
Contributor

@kyselejsyrecek kyselejsyrecek commented Sep 4, 2025

Description

SVGs generated with draw.io contain XHTML tags and are thus not compliant with the SVG 1.1 standard. While rendered correctly by web browsers and Inkscape, the svgexport package used by the gitbook executable to export SVG images fails to do so as ImageMagick and rsvg-convert do. This would result in black rectangles covering most of SVG images present in the Booting chapter.

To prevent this, let's just use Inkscape CLI to convert source SVG images directly to PNGs before building the book with gitbook. Unfortunately, it seems that inkscape has to be invoked separately for each SVG, as the interactive mode toggled with the --shell switch seems to be too buggy to do that in one run in this outdated version of Inkscape.

Optionally, the image resolution may be increased to 300 DPI if necesary. That would result in slightly larger e-book files.

Further changes:

  • Use Bash as a more user-friendly default shell for the Docker container.
  • The Docker container was updated. Installed packages were updated and packages bzip2, calibre and inkscape required for gitbook export were installed.

Related issues

image

Lukáš Chmela added 3 commits September 4, 2025 23:44
SVGs generated with draw.io contain XHTML tags and are thus not compliant with the SVG 1.1 standard. While rendered correctly by web browsers and Inkscape, the svgexport package used by the gitbook executable to export SVG images fails to do so as ImageMagick and rsvg-convert do. This would result in black rectangles covering most of SVG images present in the Booting chapter.

To prevent this, let's just use Inkscape CLI to convert source SVG images directly to PNGs before building the book with gitbook. Unfortunately, it seems that inkscape has to be invoked separately for each SVG, as the interactive mode toggled with the --shell switch seems to be too buggy to do that in one run in this outdated version of Inkscape.

Optionally, the image resolution may be increased to 300 DPI if necesary. That would result in slightly larger e-book files.
Installed packages were updated and packages bzip2, calibre and inkscape required for gitbook export were installed.
@kyselejsyrecek kyselejsyrecek requested a review from 0xAX as a code owner September 4, 2025 22:54
@kyselejsyrecek
Copy link
Contributor Author

Oh, so apparently the workflow does run even for pull requests from forks. :-)

@0xAX
Copy link
Owner

0xAX commented Sep 5, 2025

Looked at the generated PDF, looks great!

@0xAX 0xAX merged commit 38f5b0c into 0xAX:master Sep 5, 2025
2 checks passed
@kyselejsyrecek kyselejsyrecek deleted the svg-workaround branch September 5, 2025 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants