GitXplorerGitXplorer
d

textr-cli

public
11 stars
0 forks
5 issues

Commits

List of commits on branch master.
Verified
1dd8077b396bd85d16768670421956a1ccad33e0

Merge pull request #37 from denysdovhan/greenkeeper/npm-run-all-4.1.3

ddenysdovhan committed 5 years ago
Verified
0682b42cf9b20838e888ee16d0779a4a5032535f

Merge pull request #45 from denysdovhan/greenkeeper/assert-2.0.0

ddenysdovhan committed 5 years ago
Unverified
8734c4ee7093b451e276823b892ebaf5df937cf9

chore(package): update lockfile yarn.lock

ggreenkeeper[bot] committed 6 years ago
Unverified
c270bf4b68693f7ebd7385be1b5803e0e8234331

chore(package): update assert to version 2.0.0

ggreenkeeper[bot] committed 6 years ago
Unverified
431ff2ea9f1edb0d9b81cd007768f550797b233f

chore(package): update npm-run-all to version 4.1.3

ggreenkeeper[bot] committed 7 years ago
Unverified
83814d7ae6dc7f2d3141b07c384c66ed57cde759

0.4.0

ddenysdovhan committed 7 years ago

README

The README file for this repository.

textr-cli

NPM version Build Status Dependency Status

Command line interface for Textr

It can compose any functions that transforms text using Textr. For example, check out few: typographic-quotes, typographic-math-symbols, typographic-em-dashes and typographic-ellipses.

Install

Install textr globaly:

npm install -g textr-cli

Usage

After install, you can use textr command for processing your text files, like this:

# load from file, transformers required through few -t flags
$ textr foo.md -t typographic-quotes -t typographic-quotes

# load from file, transformers required through one -t
$ textr foo.md -t typographic-single-spaces,typographic-quotes

# load through stdin, iso-locale equals ru, transformers using --transforms
$ cat foo.md | textr -l ru --transforms=typographic-single-spaces

# load through stdin, write result into file
$ cat foo.md | textr -o bar.md

Options

You can use textr with specified options:

  • -t, --transforms — array of transformers, which will be applied (transformers should be installed globaly or localy in current project);
  • -o, --out-file — write output to file;
  • -l, --locale — ISO 639 locale codes (en-us as default);
  • -w, --watch — Watch changes in source file (works only with input as first argument and output through -o or --out-file flags);
  • -h, --help — show help message.

Real world

For example, you have a markdown article with some typographic mistakes, like a three pe­ri­ods instead of el­lip­sis character or whatever else. Thanks for textr-cli you can easily fix this. Just run textr with transformers which you need and get corrected text:

$ cat foo.md
Hello,   "world"...
Yet    "another" string
Yet...    one…

$ textr foo.md -t typographic-single-spaces,typographic-quotes,typographic-ellipses
Hello, “world”…
Yet “another” string
Yet… one…

Typography for everybody!

License

MIT © Denys Dovhan