terrastruct / text-to-diagram-site

Compare syntax, layouts, outputs between languages for generating diagrams with text.
https://text-to-diagram.com
GNU General Public License v3.0
399 stars 15 forks source link

Adjust PlantUML comparison to align with latest PlantUML versions. #40

Open chainofreasoning opened 1 year ago

chainofreasoning commented 1 year ago

PlantUML supports math via AsciiMath and Latex (via JLaTeXMath). The comparison presents a view of a legacy approach to generating diagrams into LaTeX versus rendering diagrams with LaTeX.

(Here's a similar project for rendering PlantUML into LaTeX: )

For rendering math in PlantUML see this area. Go here to see the recent changes and evolution.

I created an example to test:

@startuml
skinparam componentStyle rectangle
skinparam defaultTextAlignment center
skinparam defaultFontSize 14
skinparam defaultFontName Arial
skinparam component {
  borderColor DarkBlue
  backgroundColor MOTIVATION
}

[plankton] -r-> [formula \n\n\n <latex>\lim_{h \rightarrow 0 } \frac{f(x+h)-f(x)}{h}</latex> \n]: <latex>\dfrac{d}{dx}f(x)=\lim\limits_{h \to 0}\dfrac{f(x+h)-f(x)}{h}</latex>
@enduml

Paste the above at the following links to see it render:

I came across D2 as I am starting a new project and evaluating the latest in text to diagrams prior to selection of the rest of my tooling. In doing a feature/capability comparison, I found the above.

Of note in my comparison, I didn't find a functional way to add/render LaTeX to labels for connection in D2. I provided that as part of this example.

alixander commented 1 year ago

@chainofreasoning thank you! I tried inserting that, but couldn't get it to work. Here's the branch, feel free to give it a shot: https://github.com/terrastruct/text-to-diagram-site/pull/42

chainofreasoning commented 1 year ago

@alixander The problem is not with the PlantUML syntax. The problem is with the classpath configuration of how the site text-to-diagram-site is executing PlantUML. I'll put the notes in #42.

alixander commented 1 year ago

yeah i'm sure the syntax is fine, as i was able to repro on their web runner. but it needs to be reproducible locally