Hex.pmBuild StatusInline docs

An Elixir app which generates text-based tables for display

Currently supports output:

####Features

1

####Stability

This software is pre-v1 and therefore the public API may change; any breaking changes will be clearly denoted in the CHANGELOG. After v1, the API will be stable.

####Documenation

See the quick start below or check out the full API docs at HexDocs.

Installation

The package is available on Hex, therefore:

Addtable_rex to your list of dependencies in mix.exs:

def deps do
  [{:table_rex, "~> 0.2.0"}]
end

Then starttable_rex by adding it to application/0 in mix.exs:

def application do
  [applications: [:logger, :table_rex]]
end

##Quick Start

Use the TableRex.quick_render and TableRex.quick_render! functions; for those that just want a table quickly.

Given this data:

title = "Drum & Bass Releases"
header = ["Artist", "Track", "Label", "Year"]
rows = [
  ["Konflict", "Cyanide", "Renegade Hardware", 1999],
  ["Marcus Intalex", "Temperance", "Soul:r", 2004],
  ["Kryptic Minds", "The Forgotten", "Defcom Records", 2007]
]

###TableRex.quick_render!/1

rows
|> TableRex.quick_render!
|> IO.puts
+-----------------+---------------+-------------------+------+
|    Konflict     |    Cyanide    | Renegade Hardware | 1999 |
| Marcus Intalex  |  Temperance   |      Soul:r       | 2004 |
|  Kryptic Minds  | The Forgotten |  Defcom Records   | 2007 |
+-----------------+---------------+-------------------+------+

###TableRex.quick_render!/2

rows
|> TableRex.quick_render!(header)
|> IO.puts
+----------------+---------------+-------------------+------+
|     Artist     |     Track     |       Label       | Year |
+----------------+---------------+-------------------+------+
|    Konflict    |    Cyanide    | Renegade Hardware | 1999 |
| Marcus Intalex |  Temperance   |      Soul:r       | 2004 |
| Kryptic Minds  | The Forgotten |  Defcom Records   | 2007 |
+----------------+---------------+-------------------+------+

###TableRex.quick_render!/3

rows
|> TableRex.quick_render!(header, title)
|> IO.puts
+-----------------------------------------------------------+
|                   Drum & Bass Releases                    |
+----------------+---------------+-------------------+------+
|     Artist     |     Track     |       Label       | Year |
+----------------+---------------+-------------------+------+
|    Konflict    |    Cyanide    | Renegade Hardware | 1999 |
| Marcus Intalex |  Temperance   |      Soul:r       | 2004 |
| Kryptic Minds  | The Forgotten |  Defcom Records   | 2007 |
+----------------+---------------+-------------------+------+

##Run the tests

We have an extensive test suite which helps showcase project usage. For example: the quick render functions, table manipulation API or the text renderer module.

To run the test suite, from the project directory, do:

mix test

##Roadmap/Contributing

We use the Github Issues tracker.

If you have found something wrong, please raise an issue.

If you’d like to contribute, check the issues to see where you can help.

Contributions are welcome from anyone at any time but if the piece of work is significant in size, please raise an issue first.

##License

MIT. See the full license.