11# GoAT: Go ASCII Tool
22
3- This is a Go implementation of [markdeep.mini.js]'s ASCII diagram
4- generation.
3+ ## What **goat** Can Do For You
54
6- ## Update (2022-02-07)
5+ * From a chunky ASCII-art source drawing, render to a pretty SVG output file,
6+ with (goat)[./cmd/goat] run from the shell command line.
77
8- I hacked together GoAT a number of years ago while trying to embed some
9- diagrams in a Hugo project I was playing with. Through an odd twist of fate
10- GoAT eventually made its way into the upstream Hugo project, and if you're
11- using [v0.93.0] you can embed these diagrams natively. Neat!
8+ * Build publication-ready illustrated documentation, in Markdown, directly
9+ from comments in Go source code.
10+ (goatdoc)[./cmd/goatdoc] reformats the output of 'go doc -all' into Github-flavored Markdown.
11+ Any embedded goat-format drawings are processed into SVG for inclusion within
12+ the Markdown.
1213
13- My original implementation was certainly buggy and not on par with markdeep.
14- I'm grateful for the folks who've helped smooth out the rough edges, and I've
15- updated this project to reflect the good changes made in the Hugo fork,
16- including a long-overdue `go.mod`.
14+ ## You Will Also Need
1715
18- There's a lot I would like to do with this project that I will never get to, so
19- instead I recommend you look at these forks:
16+ #### Rectangle or Graphical editing capability
17+ Both **vim** and **emacs** offer useful support.
18+ In Emacs, see the built-in rectangle-editing commands, and ```picture-mode```.
2019
21- * [@bep] is the fork currently used by Hugo, which I expect to be more active
22- over time.
23- * [@dmacvicar] has improved SVG/PNG/PDF rendering.
24- * [@sw46] has implemented a really wonderful hand-drawn style worth checking
25- out.
20+ #### A fixed-pitch font with 2:1 height:width, for your editor and terminal emulator both
21+ Most fixed-pitch ("monospace") Unicode fonts maintain a 2:1 aspect ratio for all
22+ characters in the ASCII range,
23+ and all **goat** drawing characters are ASCII.
24+ However, certain Unicode graphical characters e.g. MIDDLE DOT may be useful, and
25+ conform to the width of the ASCII range.
2626
27- ## Usage
27+ CJK characters on the other hand are typically wider than 2:1.
28+ Non-standard width characters are not in general composable on the left-right axis within a plain-text
29+ drawing, because the remainder of the line of text to their right is pushed out of alignment
30+ with rows above and below.
2831
29- ```bash
30- $ go get github.com/blampe/goat
31- $ cat my-cool-diagram.txt | goat > my-cool-diagram.svg
32- ```
33-
34- By default, the program reads from stdin, unless `-i infile` is given.
32+ ## Goat Library API
3533
36- By default, the program writes to stdout, unless `-o outfile` is given.
34+ The core engine of ```goat``` is accessible as a Go package, for inclusion in specialized
35+ Go code of your own.
36+ Documented [here]({{.Root}}/API.html).
37+ The goat library is a Go implementation of [markdeep.mini.js]'s ASCII diagram generation.
3738
38- ## Tenets
39+ ## Project Tenets
3940
40411. Utility and ease of integration into existing projects are paramount.
41422. Compatibility with MarkDeep desired, but not required.
@@ -53,7 +54,8 @@ By default, the program writes to stdout, unless `-o outfile` is given.
5354
5455## Examples
5556
56- Here are some SVGs and the UTF-8 input they were generated from:
57+ Here are some SVGs, as linked to via HTML <img> elements within the Github-processed Markdown
58+ output of this README.md, along with the UTF-8 input they were generated from.
5759
5860### Trees
5961
0 commit comments