diff options
author | Alfredo Canziani <alfredo.canziani@gmail.com> | 2013-05-28 20:32:06 +0400 |
---|---|---|
committer | Alfredo Canziani <alfredo.canziani@gmail.com> | 2013-05-28 20:32:06 +0400 |
commit | 06c291b34a1838f01ffc685c457fec529ed60532 (patch) | |
tree | d28a85515c2b329cb43c2172242a960193908eb8 | |
parent | 44e819ac4d3f7a09216d0d4dce42aea51a456f97 (diff) |
Update README.md
Converted README from <txt> to <md>
Reformatted the documentation
Added instruction about *how* to use <sys.COLORS>
-rw-r--r-- | README.md | 26 |
1 files changed, 22 insertions, 4 deletions
@@ -1,10 +1,15 @@ -DEPENDENCIES: +# Lua *system* package + +## Dependencies Torch7 (www.torch.ch) -INSTALL: -$ torch-pkg install sys +## Install +``` +$ luarocks install sys +``` -USE: +## Use +``` $ torch > require 'sys' > for k in pairs(sys) print(k) end -- gives you all the included functions @@ -28,3 +33,16 @@ concat basename clock filep +``` + +### sys.COLORS +If you'd like print in colours, follow the following snippets of code. Let start by listing the available colours +``` +$ torch +> for k in pairs(sys.COLORS) do print(k) end +``` +Then, we can generate a shortcut `c = sys.COLORS` and use it within a `print` +``` +> c = sys.COLORS +> print(c.magenta .. 'This ' .. c.red .. 'is ' .. c.yellow .. 'a ' .. c.green .. 'rainbow' .. c.cyan .. '!') +``` |