-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Open
Labels
Description
In order to produce consistent documentation with images I need to inline images (SVG, PNG, Jpeg) as base64 with proper mimetype. AI build a wrapper script with a shell function inline_images that does the job for me:
$REDOCLY bundle "$src" -o "$out_json" --ext json
inline_images "$out_json" "$src"
It works fine with input in yaml:
<img style="float:right; margin:0 0 1.2em 1.2em; max-width:50%; height:auto;" src="../images/partner_logic.svg" alt="Partner SYNC Logik" />
converted to:
<img style="float:right; margin:0 0 1.2em 1.2em; max-width:50%; height:auto;" src="data:image/svg+xml;base64,PD94bWwgdmVy...
But I think redocly should be able to do inlining and setting mimetype by filename extension (.svg > image/svg+xml) for most used file types like svg and png.