eiffel-community / eiffel-sepia

Sepia Eiffel Protocol Implementation Architecture
Apache License 2.0
2 stars 6 forks source link

Un-inline SVG images #16

Closed magnusbaeck closed 2 years ago

magnusbaeck commented 3 years ago

Description

SVG images are currently both inlined in the HTML files (index.html and test-orchestration.html) and stored in discrete files in the svg directory. To make editing easier we should only use the discrete files and include them in the HTML via OBJECT elements (IMG won't work because it doesn't support interactivity like the hyperlinks we use). https://vecta.io/blog/best-way-to-embed-svg and https://stackoverflow.com/questions/4476526/do-i-use-img-object-or-embed-for-svg-files indicate that OBJECT elements work fine for interactive SVGs. A data-include attribute might also work.

Motivation

It's currently tedious to edit the files and there's no automatic mechanism for keeping the copies of data in sync (or checking whether they are in sync).

Exemplification

In #10 I'm going to have to update overview.svg, and as it stands I have to update that file and copy/paste it into index.html (with correct indentation).

Benefits

It'll be much easier to edit the SVG images. Reviews of such changes will also be easier and the risk of mistakes will decrease.

Possible Drawbacks

None I can think of, but I don't know what considerations were done when the current method was chosen. Maybe it was reasonable at the time for backwards compatibility reasons but browsers have moved on since 2016.

m-linner-ericsson commented 3 years ago

As some have had problems editing the SVGs maybe we need to state somewhere what tools to use as that is not obvious

magnusbaeck commented 3 years ago

For editing the embedded SVGs, you mean? Yes, I wasn't able to find such a tool either. Even if such tools exist, why would we then keep the standalone SVG files? Right now it seems like the intended workflow is to edit the standalone file with any SVG editor and then copy/paste the file's contents it into the HTML file.

m-linner-ericsson commented 3 years ago

Yes, let us not copy the SVG copy into the HTML but inline it instead.

magnusbaeck commented 3 years ago

Wait, did you mean "include it instead"? It's the current inlining situation that's problematic.

m-linner-ericsson commented 3 years ago

I was trying to agree with you...