1.0.3 • Published 12 months ago

prettier-plugin-sort-markdown-table v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

prettier-plugin-sort-markdown-table

npm version npm downloads codecov

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 | zhang@a.com  | zhang  |
| wang | wang@a.com   | wang |
| li | li@a.com   | li  |
| amity | amity@a.com  | amity  |
| batman | batman@a.com | batman |

Becomes:

<!-- prettier-sort-markdown-table -->

| name   | email        | description |
| ------ | ------------ | ----------- |
| amity  | amity@a.com  | amity       |
| batman | batman@a.com | batman      |
| li     | li@a.com     | li          |
| wang   | wang@a.com   | wang        |
| zhang  | zhang@a.com  | zhang       |

License

MIT © Doma

1.0.3

12 months ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago