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
+30-20Lines changed: 30 additions & 20 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 padding to make the columns more spaced out from each other. Default: `0` (no extra spacing/padding).
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).
The core formatting logic is available as a node docker image: `docker pull darkriszty/prettify-md`.
67
+
```
60
68
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.
69
+
## Docker & CLI
65
70
66
-
## CLI
71
+
The core formatting logic is available as a node docker image: `docker pull darkriszty/prettify-md` or as a stand alone CLI tool.
67
72
68
-
Formatting files or checking if they're already formatted is possible from the command line. This requires `node` and `npm` (optionally also `npx`).
73
+
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`).
69
74
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`|
78
+
| 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`|
79
+
| Check whether a file is pretty or not |`docker container run -i darkriszty/prettify-md --check < input.md`|`npm run --silent check-md < input.md`|
80
+
| Use `1` as column padding |`docker container run -i darkriszty/prettify-md --columnPadding=1 < input.md`|`npm run --silent prettify-md -- --columnPadding=1 < input.md`|
74
81
75
-
> 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.
82
+
> Notes:
83
+
> * The prettify check (`--check` or `check-md`) will fail with an exception and return code `1` if the file is not prettyfied.
84
+
> * 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.
85
+
> * The `--` after the npm run script part is needed for npm to forward the arguments (for instance `--columnPadding=1`) to the actual prettyfier script.
86
+
> * Optionally, use `npx` to prettify files: `npx markdown-table-prettify < input.md` instead of `npm run --silent prettify-md < input.md`.
76
87
77
88
### Installation
78
89
79
-
To access the CLI, the extension can either be used from the Github sources, from the already instaledl VSCode extension or from NPM.
90
+
To access the CLI, the extension can either be used from the Github sources, from the already installed VSCode extension or from NPM.
80
91
81
92
#### Compiling from the source code
82
93
83
-
- Download the source code.
84
-
- Go to the extension directory.
94
+
- Clone or download the source code.
85
95
- Run `npm install`.
86
96
- Run `npm run compile`.
87
97
@@ -94,7 +104,7 @@ Locate the installed extension path. The typical location of the installed exten
94
104
95
105
#### Getting it from NPM
96
106
97
-
Install the NPM package `npm install -g markdown-table-prettify`. Optionally, use `npx` to prettify files: `npx markdown-table-prettify < input.md` (instead of `npm run --silent prettify-md < input.md`).
107
+
Install the NPM package `npm install -g markdown-table-prettify`.
0 commit comments