blampe / goat Goto Github PK
View Code? Open in Web Editor NEWRender ASCII art as SVG diagrams
License: MIT License
Render ASCII art as SVG diagrams
License: MIT License
SVG strokes in 'currentColor' from (https://cdn.rawgit.com/blampe/goat/master/examples/trees.svg) et al. render as black, irrespective of page background color. If the user happens to have set one of the Github "Dark ..." per-user Theme, result is black strokes on a background in some shade of dark-grey, possibly indistinguishable on certain monitors.
Theme setting:
(https://github.com/settings/appearance)
Verified on Firefox and Safari.
This is super cool. Would you consider releasing downloadable binaries?
O +-------+
-|--->| hi! |
/ \ +-------+
I'd like this to be a bit more gender-neutral.
Sometimes corners that are close to each other cannot be rendered as desired:
The following is kind of expected:
+----------+
| PCRn |
+----------+
+----------+
| Nonce |
+----------+
It would be great if using other corners would not connect the two boxes:
+----------+
| PCRn |
'----------'
.----------.
| Nonce |
+----------+
but it currently renders the same as with +
I have four nodes arranged in a square like so:
.---. .---.
| CTR +-+ WBK |
'-+-' '-+-'
| |
.-+-. .-+-.
| HWD +-+ SDO |
'---' '---'
I'd like to diagonally connect the HWD and WBK nodes from their nearest corners, but haven't found a good solution. Most come out mishapen or connect the sides of the nodes rather than their corners. Any ideas? The horizontal and vertical space between nodes can be increased if that makes it any easier.
Try:
echo "and over" | ./.local/go/bin/goat /dev/stdin > x.svg
the letter o alone is transformed into a large circle, the rest of the text is fine.
The code section of small grids is below the example of it,
check it out.
Is there an easy way to include a link in a goat diagram?
what I found so far: all major browsers support [XLinks in SVG]. So it seems doable for goat as it builds an svg.
Though not much documentation is available for goat. If there is no native solution could you advise on how to approach the development of such a feature in goat or is it a “dead-end” and such a feature is not approachable by design.
Goat defines runes in the source code, should there be one for links?
Have you considered limited support for reading and interpreting unicode characters?
U+00B7 middle dot could be used for dotted lines, instead of hyphen
Or, using math symbols: http://jrgraphix.net/r/Unicode/2200-22FF
U+22EE ⋮ vertical 3 dots
U+22EF ⋯ horizontal 3 dots
U+22F0 ⋰ dotted slash
U+22F1 ⋱ dotted backslash
Box drawing lines: http://jrgraphix.net/r/Unicode/2500-257F
(includes rounded conrners, diagonal crossover etc).
Unicode arrows: http://jrgraphix.net/r/Unicode/2190-21FF
Supplementary arrows A: http://jrgraphix.net/r/Unicode/27F0-27FF
Supplementary arrows B: http://jrgraphix.net/r/Unicode/2900-297F
(oh my eyes)
I realise that there could be no end to this, and "almost" with so many symbols and a fixed-width font, who needs SVG... (Me, me, I need SVG).
Hey,
Happy to see my changes merged back to its original. I was a little impatient when adding some diagram support to Hugo, and looking at the activity in this repo, I assumed that forking this repo would be the fastest way to getting something out the door.
But I maintain way too many repos as it is already, so I would be happy to retire my fork if you're open to look at future pull requests with bug fixes and maybe some improvements. It would be to have one canonical version of this.
Examples:
Markdeep's source became available after I hacked together this project many years ago. Its diagramToSVG
method is worth referencing.
Could goAT support writing diagrams as code?
For example, a sequence diagram [1, 3] could be
Alice -> Bob: Hello Bob!
Alice <- Bob: Hello Alice!
Also, drawing computer network diagrams is a very common task. It's even included in goAT examples [2, 4].
Describing these diagrams as text would be much easier and more robust than drawing them one ASCII byte at a time. With Hugo, this would mean just writing my diagrams, saving, and seeing them render in front of my eyes automatically when running 'hugo serve'.
ps. Thanks for goAT!
[1] https://arthursonzogni.com/Diagon/#Sequence
[2] https://github.com/bep/goat/blob/master/examples/icons.svg
Hi! Thank you for working on GoAT, I've found it very useful.
I wanted to make it available for my system so I've recently packaged it for the AUR; this way Arch Linux users can easily install the goat
command line utility using their system's package manager.
A couple of notes:
go-ascii-tool
. Unfortunately, another package (upstream) made it to the "goat" name before me. Users can always alias
. :)These examples are black lines on a black background, which doesn't work so well.
just integrated it with https://github.com/nkh/P5-App-Asciio, I'll add a nice screenshot in the doc, when I've added a few function to help generate a git commit tree more easily, of a goat generated svg.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.