Go Reference | Playground | MIT License
Touch is a lightweight markup language. It uses puncutation characters to inscribe meaning to otherwise plain text. The grammar is simple to parse, allowing for easy tooling.
Touch in a few bullet points:
- familiar syntax—follows existing conventions
- easily extensible via JSON for teams that need extra elements (removes the need for inline HTML or other flavors of the language)
- default config includes only common elements (including comments!) which should satisfy 80% of use cases
- comes with auto-formatting (think prettier or gofmt)
Online playground: http://touchlabs.io/play
- Install the latest binary from Releases or run
go get github.com/touchmarine/to
if you have Go installed. - Run
to version
to verify it's working. - Run
to build html < file.to > file.html
to convert Touch to HTML. Useto help
for details.
to fmt < file.to 1<> file.to # 1<> to write to same file we read from
to fmt -linelength 80 < file.to 1<> file.to # hard-wrap at 80 columns
See the default config for reference of all elements that come with Touch by default.
This is a quick reference of some common block elements:
/ this is a block comment
= Title
_ Subtitle
== h2
=== h3
/ numbered headings (prefixed with 1 and 1.1)
## h2
### h3
> blockquote
* note
- list
1. numbered list
/ code block
`js
function num() {
return 1
}
`
/ preformatted block
'
___________________________
< I'm an expert in my field. >
---------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
'
/ art from https://developer.mozilla.org/en-US/docs/Web/HTML/Element/pre#example
This is a quick reference of some common inline elements:
// an inline comment //
__emphasis__ // italics //
**strong** // bold //
``code``
((link))
[[link text]]((link URL))
a \ // line break //
b
/ autolinks
www.example.test
http://example.test
https://example.test
Checkout the TOUR.
Ha, get it? In Touch? Anyway, you can reach me at scout at touchlabs.io. I would love to hear your thoughts.