GitXplorerGitXplorer
d

textr-cli

public
11 stars
0 forks
5 issues

Commits

List of commits on branch master.
Verified
46b2c8073bbaad0055878cd135863f1dad5d8725

Merge pull request #35 from denysdovhan/greenkeeper/get-stdin-6.0.0

ddenysdovhan committed 7 years ago
Verified
85bb5cabdd8265080a293935085b6a3ad77b0db4

Merge branch 'master' into greenkeeper/get-stdin-6.0.0

ddenysdovhan committed 7 years ago
Verified
9c49d59e0336f5583dc7506f3e2d6de7bf7a1651

Merge pull request #34 from denysdovhan/greenkeeper/mocha-5.0.0

ddenysdovhan committed 7 years ago
Verified
b3d77821d112a1a4316f048c6ca564ca5c3a6fff

Merge branch 'master' into greenkeeper/mocha-5.0.0

ddenysdovhan committed 7 years ago
Verified
c58e5cb4af5443babc8fbd91eb65619f7cb54a45

Merge pull request #33 from denysdovhan/greenkeeper/chokidar-2.0.0

ddenysdovhan committed 7 years ago
Verified
da71168e1bb8eda3983d90414d202d5c0ac935db

Merge pull request #31 from denysdovhan/greenkeeper/npm-run-all-4.1.2

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