text-pic/README.md

46 lines
1.3 KiB
Markdown
Raw Normal View History

2021-01-19 18:06:55 +00:00
# text-pic
This tool generates a social media-friendly graphic from some text. It's especially made to be paired with [WriteFreely](https://writefreely.org), a minimalist blogging platform.
## Usage
To run this, you'll need Go installed. With that, you can compile the project:
```
go get github.com/writeas/text-pic/cmd/wfgraphic-cli
```
2021-01-20 13:54:54 +00:00
Then you can run `wfgraphic-cli` with the options below.
2021-01-19 18:06:55 +00:00
```
Usage of wfgraphic-cli:
-font string
Post font (options: "serif", "sans", "mono") (default "serif")
-i string
2021-01-20 13:54:54 +00:00
WriteFreely instance hostname (e.g. "pencil.writefree.ly")
2021-01-19 18:06:55 +00:00
-o string
Image output filename (default "out.png")
2021-01-20 13:54:54 +00:00
-size string
Image size, either a single number for a square (e.g. "900") or a combined width and height (e.g. "1080x1920") (default "1024")
2021-01-19 18:06:55 +00:00
-u string
WriteFreely author username (for multi-user instances)
```
2021-01-20 13:54:54 +00:00
The actual content of the graphic is read from `stdin`, which you can either supply when prompted to, or pipe in, for example:
```
cat quote.txt | ./wfgraphic-cli -i write.as -u blog
```
2021-01-19 18:06:55 +00:00
## Examples
2021-01-19 18:41:42 +00:00
<table>
<tr>
<td>
<img src="https://i.snap.as/NHrWle49.png" alt="Sample using default fonts." />
</td>
<td>
<img src="https://i.snap.as/8SI7lfyb.png" alt="Sample using 'sans' font and a custom domain." />
</td>
</tr>
</table>