zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.04k stars 6.18k forks source link

Use "drawio.png" editable PNGs as recommended diagram format #66597

Open mkschreder opened 6 months ago

mkschreder commented 6 months ago

Is your enhancement proposal related to a problem? Please describe. When it comes to diagrams in sphinx documentation, it is often convenient to be able to edit them without having to convert between file types. It would be a good enhancement I think to standardize the format around the editable PNG with drawio information attached in the file.

Describe the solution you'd like That a new convention is introduced to use drawio editable png as the main diagram format that will replace svgs and any other formats currently used in Zephyr documentation to represent more complex diagrams.

Describe alternatives you've considered A lot of alternatives exist but editable pngs are the most convenient of all. these images look like pngs to any existing tools but also contain raw diagram data that can be edited with drawio and then saved. They work in merge requests and they are easier to work with than for example svgs. Editable pngs are extremely versatile.

Additional context I think the main reason they are not used more is because people are not aware that the format exists.

One huge drawback about not having this standardized is that we get massive amounts of PNGs and other formats that are impossible to maintain because they don't come with source document of the diagrams. Like for example the diagrams in the bluetooth folder which all seem to be conventional pngs: https://github.com/zephyrproject-rtos/zephyr/tree/main/doc/connectivity/bluetooth/img (Correct me if I'm wrong, but I was neither able to find a source document for many of these images, nor edit them in drawio).

kartben commented 6 months ago

Thanks for the suggestion and taking the time to file an issue!

This would be an interesting thing to consider indeed, probably part of more comprehensive guidelines regarding what makes a diagram "complex", as I think Graphviz and SVG should be preferred, the former for they really allow for a "diagram as code" approach, and the latter for they leave more flexibility regarding styling and keep file size under control. Also, as far as I remember draw.io also supports editable SVG (i.e. keeps the original diagram in the file's metadata), which IMO should be preferred.

FWIW I would like to also investigate a solution such as Mermaid.js in order to expand the scope of the types of diagrams that could be managed in "source form".

thedjnK commented 6 months ago

as I think Graphviz and SVG should be preferred

+1 on graphviz being preferred over drawio

mkschreder commented 6 months ago

I also generally prefer "everything as code" approach, but I also think that it has some major limitations when it comes to diagrams.

I think editable svg would work too just as long as it works in merge requests, changelog etc without any additional post processing.

mkschreder commented 6 months ago

One huge drawback about not having this standardized is that we get massive amounts of PNGs and other formats that are impossible to maintain because they don't come with source document of the diagrams. Like for example the diagrams in the bluetooth folder which all seem to be conventional pngs: https://github.com/zephyrproject-rtos/zephyr/tree/main/doc/connectivity/bluetooth/img (Correct me if I'm wrong, but I was neither able to find a source document for many of these images, nor edit them in drawio).

cvinayak commented 6 months ago

One huge drawback about not having this standardized is that we get massive amounts of PNGs and other formats that are impossible to maintain because they don't come with source document of the diagrams. Like for example the diagrams in the bluetooth folder which all seem to be conventional pngs: https://github.com/zephyrproject-rtos/zephyr/tree/main/doc/connectivity/bluetooth/img (Correct me if I'm wrong, but I was neither able to find a source document for many of these images, nor edit them in drawio).

The context of the PNGs in the Bluetooth Controller documentation can be found here: https://github.com/zephyrproject-rtos/zephyr/pull/50842

Member companies will be able to share the original power point presentation, i assume by a formal request. Some of the documentations pre-date contribution to Zephyr Project.

But generally, these diagram need rework anyway as they tend to have become a bit stale over the years.