procrastinate-org / procrastinate

PostgreSQL-based Task Queue for Python
https://procrastinate.readthedocs.io/
MIT License
859 stars 53 forks source link

Add a state diagram to the documentation #1137

Closed medihack closed 3 weeks ago

medihack commented 2 months ago

Something similar to https://github.com/timgit/pg-boss/blob/master/docs/readme.md#job-states

ewjoachim commented 2 months ago

Note: we can do it with Mermaid, Myst supports it (so does Github Flavored Markdown)

ewjoachim commented 2 months ago

I gave it a shot and it's a bit annoying:

(also light/dark mode)

I'll post my branch as a starting point but I probably won't be spending more time on it until we know where we're going. That said, anyone willing to continue it, feel free :)

medihack commented 2 months ago

As cool as something like Mermaid is, our state chart isn't that difficult (and hopefully consistent as soon as we get the "aborting" state caused by me out again 😞). How about just creating it by hand with a SVG editor? In the SVG, we can also use CSS to support the light and dark modes. I can look into it for the v3 branch (then I don't have to include "aborting").

ewjoachim commented 2 months ago

You're probably right. Let's say the question is whether we just intend to have a single graph or if we can think of other parts of the doc that could benefit from some of the graphs Mermaid supports. I don't see one right now but I'll keep a brain cell on that, and I'll try to filter actually useful ideas, not just useless but cool ones :D

medihack commented 4 weeks ago

I also gave it a shot using Mermaid but in raw mode, and I think it's quite pretty 🙂. I used the "neutral" theme, which looks ok in light and dark mode. I also put a legend below that describes the edges, making it more clear and not so bloated. The syntax error in your example came from [](), which I also did not manage to escape inside the graph (but it doesn't matter, IMHO). I built the graph in their playground, where error reporting is better. I prefer the raw mode because it is easier to build. Even the unrendered source of the graph is simple to understand.

medihack commented 3 weeks ago

Closed by #1208