Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gromnitsky/fmt-hyphen
A text formatter akin to fmt(1) but with hyphenation support
https://github.com/gromnitsky/fmt-hyphen
Last synced: about 6 hours ago
JSON representation
A text formatter akin to fmt(1) but with hyphenation support
- Host: GitHub
- URL: https://github.com/gromnitsky/fmt-hyphen
- Owner: gromnitsky
- Created: 2020-12-30T20:25:26.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-07-16T21:57:25.000Z (4 months ago)
- Last Synced: 2024-11-01T12:04:08.383Z (18 days ago)
- Language: JavaScript
- Size: 735 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# fmt-hyphen
A text formatter akin to [fmt(1)][] but with hyphenation support. Can
output images as well. Folds long words as a last resort only.[fmt(1)]: https://manpages.debian.org/unstable/coreutils/fmt.1.en.html
$ head -200 moby-dick.txt | fmt-hyphen -w30 --image 1.png
produces a long, narrow .png (this is a preview in
com.google.android.apps.photos):Could be used to share hot takes on twitter w/o using twitter
"threads". Also, I had nothing to do in the last days of 2020.## Installation
$ npm i -g fmt-hyphen
Tested on node 15.5.0, f33.
## Usage
~~~
$ head -10 moby-dick.txt | ./fmt-hyphen -w30
MOBY-DICK; or, THE WHALE.By Herman Melville
CHAPTER 1. Loomings.
Call me Ishmael. Some years
ago—never mind how long pre‐
cisely—having little or no
money in my purse, and nothing
particular to interest me on
shore, I thought I would sail
about a little and see the wa‐
tery part of the world. It is
a way I have of driving off
the spleen and
~~~Print supported language patterns (`-l` option to select):
~~~
$ ./fmt-hyphen --lang-list | column
be en-us hy nl ta
bn es it or te
ca fi kn pa tr
cs fr la pl uk
da grc lt pt
de gu lv sk
el-monoton hi ml sl
el-polyton hu nb-no sv
~~~## License
MIT