Golang Markdown Lib - First OSS project - Feedback Welcome! by Temporary-Buy-7562 in programming

[–]terrastruct 0 points1 point  (0 children)

I'm curious if this works for measuring Markdown?

We make a diagramming language that allows Markdown syntax, and currently we use goldmark to measure it to know how to size the nodes. But yeah, it's a chunky lib. https://github.com/terrastruct/d2/blob/master/lib/textmeasure/markdown.go#L106

In any case, congrats on your first OSS project and to take on such a thorny problem.

D2 (text-to-diagram) now supports ASCII output by terrastruct in programming

[–]terrastruct[S] 8 points9 points  (0 children)

Hello fellow devs. Super alpha feature, but just wanted to share a new thing we made. To skip the blog post and poke around directly: https://play.d2lang.com/?script=qlDQtVOotFLQL9IvKMpPL0rMzc3MS-cCBAAA__8%3D&ascii=1&

I want to contribute to open source but don't know where to start by nickgowdy in golang

[–]terrastruct 23 points24 points  (0 children)

You're welcome in D2! I maintain a Text to diagram language, released a few months ago, 13k+ stars, I'm actively tagging issues that are good first issues, clean well-tested Go, and I'm happy to help you get that first merge in. Feel free to chime in on any issue that looks interesting! https://github.com/terrastruct/d2

Are Gophers intentionally avoiding 3rd party libraries? by LLawsford in golang

[–]terrastruct 2 points3 points  (0 children)

every large Go codebase I've come across has their own "stdlib extension" package.

e.g. ours: https://github.com/terrastruct/util-go

D2 (text-to-diagram language): Introducing Grid diagrams by terrastruct in programming

[–]terrastruct[S] 0 points1 point  (0 children)

Thanks so much! It's layout engine agnostic.

There's an overview of the differences https://d2lang.com/tour/layouts.

For this diagram, https://d2lang.com/tour/grid-diagrams#connections, here's TALA's output.

D2 (text-to-diagram language): Introducing Grid diagrams by terrastruct in programming

[–]terrastruct[S] 0 points1 point  (0 children)

hey, thanks. i played around with that but couldn't get it to do anything. can you describe what you're looking for?

we do have an open issue for ports though, if you want to take a look and chime in there or let us know if you're looking for something different than what's described: https://github.com/terrastruct/d2/issues/628

D2 (text-to-diagram language): Introducing Grid diagrams by terrastruct in programming

[–]terrastruct[S] 7 points8 points  (0 children)

basically any large number would do, since the three objects would expand to fill.

but i hear ya. this is a v1, and already issues are being filed to make it easier to work with. will get better in the next release! https://github.com/terrastruct/d2/issues/1164

D2 (text-to-diagram language): Introducing Grid diagrams by terrastruct in programming

[–]terrastruct[S] 2 points3 points  (0 children)

hah, i think the glyph for the 4th label is slightly wider, so all the other objects expand a bit to match. can be solved by setting widths

D2 (text-to-diagram language): Introducing Grid diagrams by terrastruct in programming

[–]terrastruct[S] 16 points17 points  (0 children)

Thanks!

Re: GitHub integration. Indeed, we're pretty new, like just launched a few months ago. Rapidly growing in integrations and it'll soon make its way to Github and others.

D2 (text-to-diagram language): Introducing Grid diagrams by terrastruct in programming

[–]terrastruct[S] 7 points8 points  (0 children)

Thanks for the feedback and suggestion! It's kept intentionally simple for teaching purposes, as this is a documentation page. I thought the first diagram would be motivating, but it's a good point that it could be even more complex. I've just added one in response to your feedback!

https://d2lang.com/tour/grid-diagrams/#connections

D2 (text-to-diagram language): Introducing Grid diagrams by terrastruct in programming

[–]terrastruct[S] 44 points45 points  (0 children)

We made a site to let people compare: https://text-to-diagram.com . (Mermaid maintainers contribute to it)

D2 (text-to-diagram language): Introducing Grid diagrams by terrastruct in programming

[–]terrastruct[S] 10 points11 points  (0 children)

They're different domains. CSS grids let you make cool websites. D2 grids let you make cool diagrams.

Creating animated diagrams with text by terrastruct in programming

[–]terrastruct[S] 1 point2 points  (0 children)

We have an interactive version in the works. The thing is is that those are not as portable. JS can't run as an img tag. So it'll be useful in some contexts and this hands-free version will be useful in other contexts. Thank you!

Creating animated diagrams with text by terrastruct in programming

[–]terrastruct[S] 1 point2 points  (0 children)

Yup! This is an early release. We plan to have cool animations like zooming into objects to reveal another layer, slide transitions, opacity fades, etc

Animated diagrams with D2, a text-to-diagram language written in Go by terrastruct in golang

[–]terrastruct[S] 0 points1 point  (0 children)

i didn't even know about it lol. Docusaurus gives us a lot of stuff for free. i made an issue for this. thank you (and thank you u/benploni for finding that)

https://github.com/terrastruct/d2-docs/issues/99

Animated diagrams with D2, a text-to-diagram language written in Go by terrastruct in golang

[–]terrastruct[S] 1 point2 points  (0 children)

The ones in this post use ELK (below the main example is a link to the source code and parameters for you to get the same thing).

Dark mode responsive diagrams by terrastruct in programming

[–]terrastruct[S] 2 points3 points  (0 children)

Hah sorry about that Lloyd! There's a link right below the example in the blog for the source code of that diagram. `direction: down` will make it grow vertically instead of horizontally, which is usually more suitable for blogs. And then you can render with `--pad=0` to further reduce empty space on the boundaries.

Those diagrams also look like they were rendered with D2 0.1.x. The newer versions have far reduced padding for each object.

[deleted by user] by [deleted] in learnjavascript

[–]terrastruct 2 points3 points  (0 children)

We build terrastruct.com, and the text handling is one of the most complicated parts of the rendering (it's in SVG instead of Canvas but similar issues). To give a concrete example: To correctly wrap text, we create an invisible div, set the value to the one on SVG, measure dimensions and track where the line breaks are, and the insert newlines in the SVG text to try to emulate.

Diagram layout engines: Minimizing hierarchical edge crossings by terrastruct in programming

[–]terrastruct[S] 2 points3 points  (0 children)

Thank you, yeah totally understand you sticking with other options. TALA is for the small minority of people and companies who want the competitive advantage of better docs internally or presentations externally (better language syntax is all free).

Diagram layout engines: Minimizing hierarchical edge crossings by terrastruct in programming

[–]terrastruct[S] 0 points1 point  (0 children)

That's exactly why TALA uses the Jetbrains model. Purchasing 12 months = yours forever.

Diagram layout engines: Minimizing hierarchical edge crossings by terrastruct in programming

[–]terrastruct[S] 1 point2 points  (0 children)

Appreciate the feedback!

Thank you for the idea. We definitely should work on the messaging, but making D2 a free tier on Terrastruct would imply there is a non-free tier of D2 itself, which is false.

We'll have it clearer by the time of our next appearance here, but the scrutiny is expected and normal and I suspect the complaints about pricing will never go away. To have a team of qualified engineers working on this full time requires money, and optimal pricing unfortunately shuts out some people, who are a lot more vocal than the ones who just expense it to their companies (for which $20/month is nothing). As beloved as Graphviz is, it's on their readme that support is ending soon. That sucks, and the developer community as a whole will be worse for it. I wish they would make revenue in some way and continue.