# HG changeset patch # User Mikael Berthe # Date 1494756283 -7200 # Node ID abaf660dc3fcb730e05321c556e417c4c900db6d # Parent 92842a4f5f8b96f45950f8862451fb234d17f17c Update documentation diff -r 92842a4f5f8b -r abaf660dc3fc README.md --- a/README.md Sun May 14 11:44:14 2017 +0200 +++ b/README.md Sun May 14 12:04:43 2017 +0200 @@ -26,9 +26,11 @@ ### Download -Check the [Release page](https://github.com/McKael/madonctl/releases) for some pre-built binaries. +Check the [Release page](https://github.com/McKael/madonctl/releases) for some +pre-built binaries. -More pre-built binaries are available from the [Homepage](https://lilotux.net/~mikael/pub/madonctl/) (development version and builds for a few other platforms). +More pre-built binaries might be available from the [Homepage](https://lilotux.net/~mikael/pub/madonctl/) +(development version and builds for a few other platforms). ## Usage @@ -55,12 +57,14 @@ ### Usage -The complete list of commands is available in the online help (`madonctl help`, `madonctl command --help`...) -or in the [manpages](https://lilotux.net/~mikael/pub/madonctl/manual/html/).\ -The [Homepage](https://lilotux.net/~mikael/pub/madonctl/) also contains a plain list of commands. +The complete list of commands is available in the online help (`madonctl help`, +`madonctl command --help`...) or in the +[manpages](https://lilotux.net/~mikael/pub/madonctl/manual/html/). ### Examples +This is a non-exhaustive list of commands, showing how madonctl works. + To post a simple "toot": ``` sh % madonctl toot "Hello, World" @@ -258,6 +262,7 @@ ## References +- [madonctl manpages](https://lilotux.net/~mikael/pub/madonctl/manual/html/) - [madon](https://github.com/McKael/madon), the Go library for Mastodon API - [Mastodon API documentation](https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md) - [Mastodon repository](https://github.com/tootsuite/mastodon) diff -r 92842a4f5f8b -r abaf660dc3fc templates/README.md --- a/templates/README.md Sun May 14 11:44:14 2017 +0200 +++ b/templates/README.md Sun May 14 12:04:43 2017 +0200 @@ -40,13 +40,18 @@ ### Template development Here's a list of available commands (please check the Go template documentation for the built-in functions): -- fromunix UNIXTIMESTAMP *converts from UNIX timestampto date* -- tolocal TEXTRFC3339DATE *converts a RFC3339 date string to a local time* -- fromhtml HTMLTEXT *converts HTML to plain text* -- wrap TEXT *rewrap text, with indent and max width* -- trim TEXT *trims text whitespace* -- color COLORSPEC *sends an ANSI color code sequence*\ - COLORSPEC is a string with the following format: `[FGCOLOR][,BGCOLOR[,STYLE]]` or `reset`. + +Function | Description +-------- | ----------- +fromunix UNIXTIMESTAMP | converts from UNIX timestampto date +tolocal TEXTRFC3339DATE | converts a RFC3339 date string to a local time +fromhtml HTMLTEXT | converts HTML to plain text +wrap TEXT | rewrap text, with indent and max width +trim TEXT | trims text whitespace +color COLORSPEC | sends an ANSI color code sequence + +*COLORSPEC* is a string with the following format: +`[FGCOLOR][,BGCOLOR[,STYLE]]` or `reset`. Examples: @@ -57,7 +62,3 @@ Message: {{color "blue"}}{{.content | fromhtml | wrap " " 80 | trim}}{{color "reset"}} ``` - -Note that the _wrap_ implementation might change in the future; currently it is -paragraph-based, not line-based, and the result can be surprising after -_fromhtml_ (carriage returns are ignored).