bevyengine / bevy-website

The source files for the official Bevy website
https://bevyengine.org
MIT License
199 stars 351 forks source link

Add a way to draw charts, graphs and diagrams from markdown / code / text #378

Open Weibye opened 2 years ago

Weibye commented 2 years ago

Motivation

Types of diagrams we should consider supporting

I've focused on diagrams already in use or known to wanted in the near future

Type Examples Notes
Gantt Diagram 1 This example isn't enough to warrant spending tons of resources supporting this type of diagram. This is more "icon" than "diagram"
Flowchart 1 Same as above
Bar Chart 1 2 3 4 5 6 7 8 9 Due to its already extensive usage, supporting this makes sense
"ECS Overview Diagram" 1 This type of diagram would be extremely useful to display at the start of every example

Potential Solutions

mermaid

What

Javascript framework for rendering various diagrams

Pros

Cons

HTML + CSS

What

By using shortcodes in Zola it is possible to create html blocs and display them in a page. However, for that to be composable and useful, we would need to add support for nested shortcodes, in which case we could write shortcodes somewhat similar to a mermaid script.

(Are there other ways to get it working?)

Pros

Cons

LaTeX

What

LaTeX is a high-quality typesetting system; it includes features designed for the production of technical and scientific documentation.

Example of how it looks in use

Pros

Cons

Feedback wanted

alice-i-cecile commented 2 years ago

I wonder if we can automatically generate something "ECS overview diagrams" as part of a Bevy editor, and then include screenshots of that through a build system 🤔 Really, these seem like a generally-useful bit of tech, rather than specific to this book.

connorgmeehan commented 6 months ago

I am looking into this again, and had a little discussion in the documentation-dev channel with a few others. I had a crack at implementing the diagrams with a few approaches: handcoding svgs, shortcode generated svgs, external assets and mermaid diagrams. Any interest in discussing further in the thread @alice-i-cecile @Weibye?

alice-i-cecile commented 6 months ago

I don't have a ton of bandwidth for this currently, but this is definitely functionality that I would like!