Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Generate flow charts from if/else code blocks
This caught my eye recently. Note the attachments, particularly the flow chart for the if/else blocks. I have never considered this visual approach, I’ve always just gone for the code route and sort of gone into The Matrix mode with text and left it at that.
Is there something can do this flow chart stuff automatically, either as an IDE function/extension? I realise it’ll have to learn the Textpattern if/else. There are plenty of open source/libre charting apps, I’m just trying to minimise the friction of writing code and visualising it (since now I’m sort of kicking myself I didn’t think of this sooner).
Offline
Re: Generate flow charts from if/else code blocks
I do these kind of flow charts constantly (both for txp and my architecture), alas not as beautiful, and many times on paper, using almost extinct technologies, like pencils.
I think the one you pointed to has been generated manually.
> Edited to add: It’s a great idea for an admin side plugin which may even help with debugging.
Last edited by colak (2020-08-11 06:43:24)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: Generate flow charts from if/else code blocks
Not entirely sure, as I haven’t used it for about 10 years, but vaguely remember Adobe Dreamweaver having a flowchart mode.
EDIT: oh, it seems they removed that after Dreamweaver MX become CS. Ignore me.
Offline
Re: Generate flow charts from if/else code blocks
Looks like VS Code has an extension that does something like that marketplace.visualstudio.com/items?itemName=AleksandarDev.vscode-sequence-diagrams
There’s more than likely extensions for other IDEs that do this in some way too.
Offline
Re: Generate flow charts from if/else code blocks
Nice one, Phil – thank you.
Offline
Re: Generate flow charts from if/else code blocks
A long time ago I used Omnigraffle (Mac only) for this. Surprise: my old (circa 2002) version still works on Catalina!
Offline
Re: Generate flow charts from if/else code blocks
giz wrote #325665:
A long time ago I used Omnigraffle (Mac only) for this. Surprise: my old (circa 2002) version still works on Catalina!
working on Mac OS Sierra
…. texted postive
Offline
Re: Generate flow charts from if/else code blocks
giz wrote #325665:
A long time ago I used Omnigraffle
Thank you. Yep, I’ve got a licence for that…somewhere…haven’t used it in time!
I was looking for something specifically that could interpret Textpattern conditional tags and visually show what the flow route would be, rather than having to build out the chart myself.
Offline
Re: Generate flow charts from if/else code blocks
Txp tags regex being rather specific, I doubt some app would do it out of the box. But a plugin based on txp_tokenize() function shouldn’t be too complex to write… with enough motivation :-)
Offline