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
[](https://marketplace.visualstudio.com/items?itemName=darkriszty.markdown-table-prettify)
Makes tables more readable for humans. Compatible with the Markdown writer plugin's table formatter feature in Atom.
6
9
7
-
## Features
10
+
## Feature highlights
8
11
9
12
- Remove redundant ending table border if the beginning has no border, so the table _will not end_ with "|".
10
13
- Create missing ending table border if the beginning already has a border, so the table _will end_ with "|".
11
14
- Save space by not right-padding the last column if the table has no border.
12
15
- Support empty columns inside tables.
13
16
- Support column alignment options with ":".
14
-
- CLI and docker support to prettify files.
17
+
- Find and format multiple tables.
18
+
- Support indented tables.
19
+
20
+
## Visual Studio Code
15
21
16
22

17
23
18
-
### CLI formatting
24
+
The extension is available for markdown language mode. It can either prettify a selection (`Format Selection`) or the entire document (`Format Document`).
25
+
A VSCode command called `Prettify markdown tables` is also available to format the currently opened document.
26
+
27
+
Configurable settings:
28
+
- The maximum texth length of a selection/entire document to consider for formatting. Defaults to 1M chars. (limit does not apply from CLI or NPM).
29
+
- Keyboard shortcut to prettify the currently opened markdown document. Default: CTRL+ALT+M (CMD+ALT+M on Mac).
30
+
31
+
## NPM
32
+
33
+
The core formatting logic is available as an NPM package: `npm install --save markdown-table-prettify`. The Typescript code is compiled down to ES5 and shipped inside the package.
34
+
35
+
It currently exposes the entry point also used by the _CLI_. It can be used from regular NodeJS or web apps:
The core formatting logic is available as a node docker image: `docker pull darkriszty/prettify-md`.
57
+
58
+
Available features from docker:
59
+
- To prettify a file: `docker container run -i darkriszty/prettify-md < input.md`.
60
+
- To prettify a file and save the output: `docker container run -i darkriszty/prettify-md < input.md > output.md`.
61
+
- 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
+
63
+
## CLI
19
64
20
65
Formatting files or checking if they're already formatted is possible from the command line. This requires `node` and `npm`.
21
66
@@ -37,24 +82,6 @@ Available features from the command line:
37
82
38
83
> 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.
39
84
40
-
### Formatting with docker
41
-
42
-
The core formatting logic of the extension is also available as a node docker image: `docker pull darkriszty/prettify-md`.
43
-
44
-
Available features from docker:
45
-
- To prettify a file: `docker container run -i darkriszty/prettify-md < input.md`.
46
-
- To prettify a file and save the output: `docker container run -i darkriszty/prettify-md < input.md > output.md`.
47
-
- 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.
48
-
49
-
## Extension Settings
50
-
51
-
The extension is available for markdown language mode. It can either prettify a selection (`Format Selection`) or the entire document (`Format Document`).
52
-
A VSCode command called `Prettify markdown tables` is also available to format the currently opened document.
53
-
54
-
Configurable settings:
55
-
- The maximum texth length of a selection/entire document to consider for formatting. Defaults to 1M chars. There is no limit when running from the command line.
56
-
- Keyboard shortcut to prettify the currently opened markdown document. Default: CTRL+ALT+M (CMD+ALT+M on Mac).
57
-
58
85
## Known Issues
59
86
60
87
- Tables with mixed character widths (eg: CJK) are not always properly formatted (issue #4).
0 commit comments