Giter Site home page Giter Site logo

tablr's Introduction

Tablr

Tablr is a simple command line utility for converting back and forth between a simple table markup language and pretty ASCII tables. It reads markup on standard in and writes the corresponding ASCII table to standard out.

The -r flag may be given to convert from an ASCII table to markup also reading and writing on standard in and out.

Markup

The tables generated by Tablr are currently very simple. A table is composed of a list of rows, each row may either by a divider or a list of cells. All rows in a table have the same number of cells.

A row of cells is specified on a single line with a | character between each cell.

A divider row is specified by a single line containing one or more - characters and nothing else.

Example

For example, the given markup:

Header 1 | Header 2 | Header 3
-
foo | bar | baz
just the first
||just the last

Will produce the following table when piped through tablr:

+----------------+----------+---------------+
| Header 1       | Header 2 | Header 3      |
+----------------+----------+---------------+
| foo            | bar      | baz           |
| just the first |          |               |
|                |          | just the last |
+----------------+----------+---------------+

VIM Integration

Tablr was originally created with VIM integration in mind. You can add the following to your ~/.vimrc file to automatically convert the paragraph under your cursor back and forth between tables and markup.

nnoremap <leader>at vip:!tablr<cr>
nnoremap <leader>ut vip:!tablr -r<cr>

tablr's People

Contributors

fimad avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.