Skip to content

Commit e85b924

Browse files
committed
Update readme, version and add additional tests
1 parent a6bc94f commit e85b924

4 files changed

Lines changed: 126 additions & 291 deletions

File tree

README.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ A VSCode command called `Prettify markdown tables` is also available to format t
2929
### Configurable settings:
3030
- The maximum texth length of a selection/entire document to consider for formatting. Default: 1M chars (limit does not apply from CLI or NPM).
3131
- Additional languages to support formatting for besides `markdown`. See possible configurable values [here](https://code.visualstudio.com/docs/languages/identifiers#_known-language-identifiers). Default: `[ ]`.
32-
- Keyboard shortcut to prettify the currently opened markdown document. Default: CTRL+ALT+M (CMD+ALT+M on Mac).
32+
- Column spacing to make the columns more spaced out from each other. Default: `0` (no extra spacing).
33+
- Keyboard shortcut to prettify the currently opened markdown document. Default: <kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>M</kbd> (<kbd>CMD</kbd>+<kbd>ALT</kbd>+<kbd>M</kbd> on Mac).
3334

3435
## NPM
3536

@@ -54,25 +55,23 @@ foo | bar
5455
*/
5556
```
5657

57-
## Docker
58+
## Docker & CLI
5859

59-
The core formatting logic is available as a node docker image: `docker pull darkriszty/prettify-md`.
60+
The core formatting logic is available as a node docker image: `docker pull darkriszty/prettify-md` or as a stand alone CLI tool.
6061

61-
Available features from docker:
62-
- To prettify a file: `docker container run -i darkriszty/prettify-md < input.md`.
63-
- To prettify a file and save the output: `docker container run -i darkriszty/prettify-md < input.md > output.md`.
64-
- To check whether a file is prettyfied or not: `docker container run -i darkriszty/prettify-md --check < input.md`. This will fail with an exception and return code `1` if the file is not prettyfied.
62+
Formatting files or checking if they're already formatted is also possible from the command line without docker. This requires `node` and `npm` (optionally also `npx`).
6563

66-
## CLI
67-
68-
Formatting files or checking if they're already formatted is possible from the command line. This requires `node` and `npm` (optionally also `npx`).
69-
70-
### Available features from the command line:
71-
- To prettify a file: `npm run --silent prettify-md < input.md`.
72-
- To prettify a file and save the output: `npm run --silent prettify-md < input.md > output.md`.
73-
- To check whether a file is prettyfied or not: `npm run --silent check-md < input.md`. This will fail with an exception and return code `1` if the file is not prettyfied.
64+
| Feature | Docker | CLI |
65+
|--------------------------------------|-------------------------------------------------------------------------------|-------------------------------------------------------------|
66+
| Prettify a file | `docker container run -i darkriszty/prettify-md < input.md` | `npm run --silent prettify-md < input.md` |
67+
| Prettify a file and save the output | `docker container run -i darkriszty/prettify-md < input.md > output.md` | `npm run --silent prettify-md < input.md > output.md` |
68+
| * Check whether a file is prettyfied | `docker container run -i darkriszty/prettify-md --check < input.md` | `npm run --silent check-md < input.md` |
69+
| Use `1` extra space between columns | `docker container run -i darkriszty/prettify-md --columnPadding=1 < input.md` | `npm run --silent prettify-md -- --columnPadding=1 < input.md` |
7470

71+
> \* : the check will fail with an exception and return code `1` if the file is not prettyfied.
72+
>
7573
> Note: the `--silent` switch sets the NPM log level to silent, which is useful to hide the executed file name and concentrate on the actual output.
74+
> Note: the `--` after the npm run script part is needed for npm to forward the arguments (for instance `--columnPadding=1`) to the actual script.
7675
7776
### Installation
7877

0 commit comments

Comments
 (0)