Convert csv to markdown.
$ go get -u -t github.com/uchiiii/csv2md
$ csv2md help
NAME:
csv2md - A new cli application
USAGE:
csv2md [global options] command [command options] [arguments...]
COMMANDS:
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--delimiter value, -d value CSV delimiter, expected values: ',', ';'. Default is , (default: ",")
--padding value, -p value The number of spaces to add between table cells and column dividers. Default is 2 spaces. (default: 2)
--help, -h show help (default: false)
# here testdata in this reository is used.
$ csv2md ./testdata/test1.csv
input: (csv file)
First Name,Last Name,Location,Allegiance
Mance,Rayder,North of the Wall,Wildlings
Margaery,Tyrell,The Reach,House Tyrell
Danerys,Targaryen,Meereen,House Targaryen
Tyrion,Lannister,King's Landing,House Lannister
output: (markdown)
First Name | Last Name | Location | Allegiance |
---|---|---|---|
Mance | Rayder | North of the Wall | Wildlings |
Margaery | Tyrell | The Reach | House Tyrell |
Danerys | Targaryen | Meereen | House Targaryen |
Tyrion | Lannister | King's Landing | House Lannister |
raw output:
First Name | Last Name | Location | Allegiance
------------|-------------|---------------------|-----------------
Mance | Rayder | North of the Wall | Wildlings
Margaery | Tyrell | The Reach | House Tyrell
Danerys | Targaryen | Meereen | House Targaryen
Tyrion | Lannister | King's Landing | House Lannister
- Newline within cell in csv is converted to
<br/>
which is newline sign in markdown.
Bug reports, fixes, or features? Feel You are wellcome opening issue or pull request any time.
Copyright (c) 2020 Ryosuke Horiuchi. Licensed under the MIT License.