Skip to content

bundle should be able to inline images #2755

@gerritgriebel

Description

@gerritgriebel

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions