You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-15Lines changed: 14 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,8 @@ A VSCode command called `Prettify markdown tables` is also available to format t
29
29
### Configurable settings:
30
30
- The maximum texth length of a selection/entire document to consider for formatting. Default: 1M chars (limit does not apply from CLI or NPM).
31
31
- 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).
33
34
34
35
## NPM
35
36
@@ -54,25 +55,23 @@ foo | bar
54
55
*/
55
56
```
56
57
57
-
## Docker
58
+
## Docker & CLI
58
59
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.
60
61
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`).
65
63
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.
| 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`|
74
70
71
+
> \* : the check will fail with an exception and return code `1` if the file is not prettyfied.
72
+
>
75
73
> 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.
0 commit comments