Topics

How to insert a picture into an HTML page so that it is not a separate file #HTML5


carole.c.girard@...
 

Has anyone tried to make the dita-ot do that? It works  if I do it manually, but for obvious reasons, we want to automate it so that when we generate HTML5 with the dita-ot, the HTML files include the images.


https://www.thesitewizard.com/html-tutorial/embed-images-with-data-urls.shtml
https://en.wikipedia.org/wiki/Base64#HTML

thanks


Radu Coravu
 

Hi Carole,

I wanted to do something like this at some point but I never got around to it. A small DITA OT plugin with a custom Java extension could probably embed images directly in the HTML content.

Or you could maybe do that after the HTML files are produced, I googled for "embed image html command line github" and there seem to be a couple of GitHub projects which claim to do that.

Regards,
Radu
Radu Coravu
Oxygen XML Editor
On 8/27/20 4:06 PM, carole.c.girard@... wrote:

Has anyone tried to make the dita-ot do that? It works  if I do it manually, but for obvious reasons, we want to automate it so that when we generate HTML5 with the dita-ot, the HTML files include the images.


https://www.thesitewizard.com/html-tutorial/embed-images-with-data-urls.shtml
https://en.wikipedia.org/wiki/Base64#HTML

thanks


Jarno Elovirta
 

Hi,

If your images are in SVG format, a plugin could embed them directly into HTML. I’ve been meaning to add this as a built-in feature in DITA-OT. That you can either inline or extract all SVG images. The same would apply to MathML.

For binary image formats you need Base64 encoding in data URL.

J

--
Sent from a mobile device.

On 28. Aug 2020, at 7.40, Radu Coravu <radu_coravu@...> wrote:



Hi Carole,

I wanted to do something like this at some point but I never got around to it. A small DITA OT plugin with a custom Java extension could probably embed images directly in the HTML content.

Or you could maybe do that after the HTML files are produced, I googled for "embed image html command line github" and there seem to be a couple of GitHub projects which claim to do that.

Regards,
Radu
Radu Coravu
Oxygen XML Editor
On 8/27/20 4:06 PM, carole.c.girard@... wrote:
Has anyone tried to make the dita-ot do that? It works  if I do it manually, but for obvious reasons, we want to automate it so that when we generate HTML5 with the dita-ot, the HTML files include the images.


https://www.thesitewizard.com/html-tutorial/embed-images-with-data-urls.shtml
https://en.wikipedia.org/wiki/Base64#HTML

thanks