Skip to content

Commit da2daae

Browse files
committed
docs: refactoring, remove replace and input description
1 parent 87b917b commit da2daae

File tree

1 file changed

+33
-63
lines changed

1 file changed

+33
-63
lines changed

readme.md

+33-63
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# posthtml-cli
2-
> Command line interface for [PostHTML][posthtml-url]
2+
> [PostHTML][posthtml-url] сommand line interface
33
4-
[![node][node-image]][node-url][![NPM version][npm-image]][npm-url][![Trasiv Build Status][travis-image]][travis-url][![AppVeyor Build Status][appveyor-img]][appveyor][![Coveralls Status][coveralls-image]][coveralls-url][![Dependency Status][depstat-image]][depstat-url][![XO code style][style]][style-url]
4+
[![Trasiv Build Status][travis-image]][travis-url][![AppVeyor Build Status][appveyor-img]][appveyor][![node][node-image]][node-url][![NPM version][npm-image]][npm-url][![Dependency Status][depstat-image]][depstat-url][![XO code style][style]][style-url][![Coveralls Status][coveralls-image]][coveralls-url]
55

6-
[![npm downloads](https://img.shields.io/npm/dm/posthtml-cli.svg?style=flat-square)](https://www.npmjs.com/package/posthtml-cli)[![npm](https://img.shields.io/npm/dt/posthtml-cli.svg?style=flat-square)](https://www.npmjs.com/package/posthtml-cli)[![Package Quality](http://npm.packagequality.com/shield/posthtml-cli.svg?style=flat-square)](http://packagequality.com/#?package=posthtml-cli)
6+
[![npm downloads][npm-download-image]][npm-download-url][![npm][npm-total-download-image]][npm-total-download-url][![Package Quality][pkg-q-image]][pkg-q-url]
77

88
## Install
99

@@ -14,73 +14,43 @@ $ npm install --global posthtml-cli
1414
1515
## Usage
1616
```bash
17-
$ posthtml [-o output-file/directory|-r] [-i input-file/directory] [OPTIONS]
18-
```
19-
> **Note:** Automatically loads plug-ins with configuration from package.json using [post-load-plugins](https://github.com/post-org/post-load-plugins) if not used `--config` key
20-
21-
## Options
22-
|Name|Type|Default|Description|
23-
|:----|:--:|:-----:|:---------|
24-
|`-o, --output`|`{String}`|`undefined`|Output File or Folder|
25-
|`-r, --replace`|`{Boolean}`|`false`|Replace Input File or Files in Input Folder|
26-
|`-i, --input`|`{String}`|`undefined`|Input File or Folder|
27-
|`-c, --config`|`{String}`|`dirname(package.json)`|Path to config file `config.[js|json]`|
28-
|`--auto-off`|`{Boolean}`|`false`|Disable automatically loads plug-ins with configuration from package.json|
29-
|`-u, --use`|`{Array}`|`[]`|PostHTML plugin name|
30-
|`-h, --help`|`{Boolean}`|`false`|CLI Help|
31-
|`-v, --version`|`{Boolean}`|`false`|CLI Version|
32-
33-
## Examples
34-
35-
### Sample
36-
```bash
37-
$ posthtml -o output.html -i input.html
17+
$ posthtml --help
18+
19+
Usage:
20+
$ posthtml <patterns>
21+
22+
Options:
23+
--output -o Output File or Folder
24+
--config -c Path to config file
25+
--use -u PostHTML plugin name
26+
--auto-off Disable automatically loads plug-ins with configuration from package.json
27+
--help -h CLI Help
28+
--version -v CLI Version
29+
30+
Examples:
31+
$ posthtml input.html
32+
$ posthtml input.html -o output.html
33+
$ posthtml inputFolder/*.html !unicorn.html
34+
$ posthtml input.html -o output.html -c posthtml.js
35+
$ posthtml input.html -o output.html -u posthtml-bem --posthtml-bem.elemPrefix __
36+
$ posthtml inputFolder/*.html -o outputFolder
37+
$ posthtml inputFolder/**/*.html -o outputFolder
3838
```
39+
>**Note:** This package does not respect the order of patterns. First, all the negative patterns are applied, and only then the positive patterns.
3940
40-
### Options config
41-
```bash
42-
$ posthtml -o output.html -i input.html -c posthtml.json
43-
```
41+
> **Note:** Automatically loads plug-ins with configuration from package.json using [post-load-plugins](https://github.com/post-org/post-load-plugins) if not used `--auto-off` key
4442
45-
```bash
46-
$ posthtml -o output.html -i input.html -c posthtml.js
47-
```
4843

49-
### Options use
50-
```bash
51-
$ posthtml
52-
-o output.html
53-
-i input.html
54-
-c config.json
55-
-u posthtml-bem
56-
--posthtml-bem.elemPrefix __
57-
--posthtml-bem.elemMod _
58-
-u posthtml-css-modules
59-
--posthtml-css-modules path/to/json
60-
-u posthtml-custom-elements
61-
```
62-
63-
### Read dir
64-
```bash
65-
$ posthtml -o outputFolder/ -i inputFolder/*.html
66-
```
67-
68-
```bash
69-
$ posthtml -o outputFolder/ -i inputFolder/**/*.html
70-
```
71-
72-
### Replace
73-
```bash
74-
$ posthtml -i input.html -r
75-
```
44+
[posthtml-url]: http://github.com/posthtml/posthtml
7645

77-
```bash
78-
$ posthtml -i inputFolder/*.html -r
79-
```
46+
[pkg-q-url]: http://packagequality.com/#?package=posthtml-cli
47+
[pkg-q-image]: http://npm.packagequality.com/shield/posthtml-cli.svg?style=flat-square
8048

81-
### License [MIT](license)
49+
[npm-total-download-url]: https://www.npmjs.com/package/posthtml-cli
50+
[npm-total-download-image]: https://img.shields.io/npm/dt/posthtml-cli.svg?style=flat-square
8251

83-
[posthtml-url]: http://github.com/posthtml/posthtml
52+
[npm-download-url]: https://www.npmjs.com/package/posthtml-cli
53+
[npm-download-image]: https://img.shields.io/npm/dm/posthtml-cli.svg?style=flat-square
8454

8555
[node-url]: ""
8656
[node-image]: https://img.shields.io/node/v/post-sequence.svg?maxAge=2592000&style=flat-square

0 commit comments

Comments
 (0)