Jay Taylor's notes
back to listing indexgoman - the missing man pages for Go binaries - Applied Go
[web search]Step 4: Render Markdown as colored ANSI text
Markdown renderers usually produce HTML, in some cases PDF, and, if they value traditional typesetting, also LaTeX. Plain text with ANSI color codes is far less widespread.
Again, luck was on my side. This fork of blackfriday implements an ANSI renderer for Markdown. So getting color-coded ANSI output from a README file required little more than copying a couple of lines from mdcat that uses the ANSI renderer under the hood.
Done.
Get goman
Get goman
via go get
:
go get -u github.com/christophberger/goman
Usage
It’s all in the README, so simply type goman goman
;-)
TL;DR:
goman <binary> # find and display the README of <binary> goman <binary> | less -R # same but with paging
And a shell script can make goman
blend in with the standard man
command, to auto-reveal the README if the binary has no man page. (See the README for instructions.)
Happy coding!
Also on Applied Go
Perceptrons - the most basic form of a neural network
- 4 comments •
- 6 months ago•
Christoph — This blog is about Go; hence a post about Python would not really fit in. Tip: Click the last link in the article to find a blog post about building a single-neuron "network" (similar to the perceptron discussed here) in Python.
Controlling a Digispark board
- 7 comments •
- 3 months ago•
Christoph — Done. And the fix for Gort issue #55 is already taken into account.
TCP/IP Networking
- 2 comments •
- 6 months ago•
Christoph — Thanks for letting me know! I fixed it.
Get into the flow
- 8 comments •
- 6 months ago•
Christoph — Hi Juliano, I use Tumult Hype to make the animations for this blog. The output is pure HTML/JS/CSS that should run in any modern browser.