prettier-plugin-sort-markdown-table
v1.0.3
Published
Prettier plugin that sorts markdown tables according to their first column
Downloads
261
Maintainers
Readme
prettier-plugin-sort-markdown-table
Prettier plugin that sorts markdown tables according to their first column.
Install
npm i -D prettier-plugin-sort-markdown-table
Prettier should automatically load this plugin once it's installed, you don't have to do manual configuration.
Usage
Annotate tables you want to sort with <!-- prettier-sort-markdown-table -->
comment.
For example:
<!-- prettier-sort-markdown-table -->
| name | email | description |
| -- | -- | --- |
| zhang | [email protected] | zhang |
| wang | [email protected] | wang |
| li | [email protected] | li |
| amity | [email protected] | amity |
| batman | [email protected] | batman |
Becomes:
<!-- prettier-sort-markdown-table -->
| name | email | description |
| ------ | ------------ | ----------- |
| amity | [email protected] | amity |
| batman | [email protected] | batman |
| li | [email protected] | li |
| wang | [email protected] | wang |
| zhang | [email protected] | zhang |
License
MIT © Doma