A markdown table generation tool from CSV/TSV.
Go
Switch branches/tags
Nothing to show
Clone or download

README.md

mdt Build Status

A markdown table generation tool from CSV/TSV.

Usage

$ mdt < hoge.csv
| headerA | headerB                |
| ------- | ---------------------- |
| short   | very very long content |

mdt is very simple command line tool, so you can integrate with other tools like pbpaste, Automator, etc...

For example, you can use mdt with Automator Service on GitHub PR/Issue page.

mdt

Features

  • Convert from CSV/TSV.
  • Auto formatting.
  • Support multibyte contents.
  • Define align at CSV/TSV header ex. :headerA:, headerB:
  • Repeating execution.
  • Specify a header line (-H option).

See also examples.

Installation

$ go get github.com/monochromegane/mdt/...

Integration

Automator

mdt_with_automator

  1. Create new Automator Service.
  2. Select Run Shell Script action.
  3. Service receives selected -> text
  4. Check Output replaces selected text
  5. Input /path/to/mdt at Run Shell Script (pass input is to stdin).

You can call the service by shortcut key.

System Preferences > Keyboard > Shortcuts tab > Services > Select your service, and set shortcut.

Contribution

  1. Fork it
  2. Create a feature branch
  3. Commit your changes
  4. Rebase your local changes against the master branch
  5. Run test suite with the go test ./... command and confirm that it passes
  6. Run gofmt -s
  7. Create new Pull Request

License

MIT

Author

monochromegane