#markdown-tables #table #markdown #generate-markdown #bnf #terminal

app mdtg

Quickly generate markdown tables in your terminal using a simplistic specification

2 stable releases

Uses old Rust 2015

1.0.1 Aug 29, 2019
1.0.0 May 24, 2019
0.1.0 May 24, 2019

#2602 in Parser implementations

Download history 16/week @ 2024-02-26 52/week @ 2024-04-01

52 downloads per month

MIT license

15KB
358 lines

Markdown Table Generator mdtg

Crates.io

Quickly generate markdown tables in your terminal using a simplistic specification.

Installation

crates.io

$ cargo install mdtg

Manual

$ git clone https://github.com/lukakerr/mdtg.git
$ cargo run

Usage

# Create a 4 by 4 table, without spaces in argument
$ mdtg 4x4

|        |        |        |        |
| ------ | ------ | ------ | ------ |
|        |        |        |        |
|        |        |        |        |
|        |        |        |        |
|        |        |        |        |

# Create a 3 by 5 table, with left, center and right aligned columns
$ mdtg "3lcr x 5"

|        |        |        |
| ------ |:------:| ------:|
|        |        |        |
|        |        |        |
|        |        |        |
|        |        |        |
|        |        |        |

BNF Grammar

Spec      -> Column Cross Row
Column    -> Num Positions
Row       -> Num
Num       -> Digit | Digit Num
Digit     -> [0-9]
Cross     -> "x"
Positions -> Position | Position Positions
Position  -> "l" | "r" | "c"

No runtime deps