Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nvuillam/markdown-table-formatter
Check markdown tables formatting and apply fixes
https://github.com/nvuillam/markdown-table-formatter
formatter markdown markdown-table megalinter prettier prettify table
Last synced: 2 days ago
JSON representation
Check markdown tables formatting and apply fixes
- Host: GitHub
- URL: https://github.com/nvuillam/markdown-table-formatter
- Owner: nvuillam
- License: mit
- Created: 2021-01-13T14:56:56.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T22:51:35.000Z (17 days ago)
- Last Synced: 2024-10-30T03:53:29.296Z (17 days ago)
- Topics: formatter, markdown, markdown-table, megalinter, prettier, prettify, table
- Language: JavaScript
- Homepage:
- Size: 746 KB
- Stars: 23
- Watchers: 2
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Markdown table formatter
[![Version](https://img.shields.io/npm/v/markdown-table-formatter.svg)](https://npmjs.org/package/markdown-table-formatter)
[![Downloads/week](https://img.shields.io/npm/dw/markdown-table-formatter.svg)](https://npmjs.org/package/markdown-table-formatter)
[![Downloads/total](https://img.shields.io/npm/dt/markdown-table-formatter.svg)](https://npmjs.org/package/markdown-table-formatter)
[![Mega-Linter](https://github.com/nvuillam/markdown-table-formatter/workflows/Mega-Linter/badge.svg)](https://github.com/nvuillam/mega-linter#readme)
[![Generated by github-dependents-info](https://img.shields.io/static/v1?label=Used%20by&message=24&color=informational&logo=slickpic)](https://github.com/nvuillam/markdown-table-formatter/blob/main/docs/github-dependents-info.md)
[![codecov](https://codecov.io/gh/nvuillam/markdown-table-formatter/branch/master/graph/badge.svg)](https://codecov.io/gh/nvuillam/markdown-table-formatter)
[![GitHub contributors](https://img.shields.io/github/contributors/nvuillam/markdown-table-formatter.svg)](https://gitHub.com/nvuillam/markdown-table-formatter/graphs/contributors/)
[![GitHub stars](https://img.shields.io/github/stars/nvuillam/markdown-table-formatter?label=Star&maxAge=2592000)](https://GitHub.com/nvuillam/markdown-table-formatter/stargazers/)
[![License](https://img.shields.io/npm/l/markdown-table-formatter.svg)](https://github.com/nvuillam/markdown-table-formatter/blob/master/LICENSE)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)Format markdown tables in files, using embedded [markdown-table-prettify](https://www.npmjs.com/package/markdown-table-prettify)
[![Banner](https://raw.githubusercontent.com/nvuillam/markdown-table-formatter/master/docs/assets/images/banner.jpg)](https://github.com/nvuillam/markdown-table-formatter#readme)
## Table of contents
- [Installation](#installation)
- [Local](#local)
- [Global](#global)
- [Usage](#usage)
- [Options](#options)
- [Examples](#examples)
- [Continuous Integration](#continuous-integration)
- [Ignoring Code Blocks](#ignoring-code-blocks)
- [Contribute](#contribute)
- [Release notes](#release-notes)## Installation
### Local
```shell
npm install markdown-table-formatter --save
```### Global
```shell
npm install markdown-table-formatter -g
```## Usage
```shell
markdown-table-formatter [OPTIONS] (file(s) or glob expression)
```### Options
| Parameter | Description | Default value |
|----------------|-----------------------------------|---------------|
| -c
--check | Check only, does not update files | `false` |
| -p
--columnpadding | Override column padding number of spaces |
| -h
--help | Displays help | |
| -v
--version | Displays version | |## Examples
Format all markdown files found within current directory
```shell
markdown-table-formatter
```Format all markdown files found with a glob expression
```shell
markdown-table-formatter **/docs/*.md
```Format markdown tables in a single file
```shell
markdown-table-formatter myfile.md
```Format markdown tables in a multiple file
```shell
markdown-table-formatter myfile.md anotherFile.md andAnotherFile.md
```Check if markdown table formatting is necessary in a single file
```shell
markdown-table-formatter --check myfile.md
```Check if markdown table formatting is necessary in a multiple files
```shell
markdown-table-formatter --check myfile.md anotherFile.md andAnotherFile.md
```You can see **more examples in** [**test methods**](https://github.com/nvuillam/markdown-table-formatter/blob/master/test/markdown-table-formatter.test.js)
## Continuous Integration
You can automatically check markdown tables formatting and fix it using [MegaLinter](https://github.com/oxsecurity/megalinter/), that embeds markdown-table-formatter out of the box
## Ignoring Code Blocks
You may wish to ignore specific markdown content, especially when using with [Megalinter](https://github.com/oxsecurity/megalinter) or [terraform-docs](https://github.com/terraform-docs/terraform-docs)
To achieve this, place tags `` and `` around the content you want markdown-table-formatter to ignore.
## Contribute
Contributions are very welcome !
Please follow [Contribution instructions](https://github.com/nvuillam/markdown-table-formatter/blob/master/CONTRIBUTING.md)
## Release Notes
See complete [CHANGELOG](https://github.com/nvuillam/markdown-table-formatter/blob/master/CHANGELOG.md)