Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/choptastic/quicktable
A Nitrogen plugin for an abbreviated way to draw HTML tables
https://github.com/choptastic/quicktable
Last synced: 21 days ago
JSON representation
A Nitrogen plugin for an abbreviated way to draw HTML tables
- Host: GitHub
- URL: https://github.com/choptastic/quicktable
- Owner: choptastic
- Created: 2013-12-03T02:56:03.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2022-07-08T22:16:02.000Z (over 2 years ago)
- Last Synced: 2024-10-08T15:25:03.405Z (about 1 month ago)
- Language: Erlang
- Size: 5.86 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
# quicktable
A plugin adding a more succint way of specifying tables for the [Nitrogen Web Framework](http://nitrogenoproject.com)
## Installing into a Nitrogen Application
Add it as a rebar dependency by adding into the deps section of rebar.config:
```erlang
{quicktable, ".*", {git, "git://github.com/choptastic/quicktable.git", {branch, master}}}
```### Using Nitrogen's built-in plugin installer (Requires Nitrogen 2.2.0)
Run `make` in your Application. The rest should be automatic.
### Manual Installation (Nitrogen Pre-2.2.0)
Run the following at the command line:
```shell
./rebar get-deps
./rebar compile
```Then add the following includes into any module requiring the form
```erlang
-include_lib("quicktable/include/records.hrl").
```## Usage
```erlang
#quicktable{
html_encode=true,
data=[
["R1C1", "R1C2", "R1C3"],
["R2C1", "R2C2", "R2C3"],
["R3C1", "R3C2", "R3C3"]
]
}.
```
or - enabling interpretation of first row as header:```erlang
#quicktable{
html_encode=true,
first_row_is_header=true,
data=[
{"HeaderC1", "HeaderC2", "HeaderC3"},
{"tupleR2C1", "tupleR2C2", "tupleR2C3"},
{"tupleR3C1", "tupleR3C2", "tupleR3C3"}
]
}.
```The `data` attribute is a list of rows, with the each row merely being a list
of cells, and the cell contents being encoded either with the specified
`html_encode` attribute, or a simple body.## License
Copyright (c) 2013, [Jesse Gumm](http://jessegumm.com)
([@jessegumm](http://twitter.com/jessegumm))MIT License