Skip to content

Commit

Permalink
changed readme a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
erhard committed May 29, 2014
1 parent 1f6bd52 commit c77fca3
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,38 @@ mixItRuby

What is mixItRuby ?
-------------
Mix is a gem for mixing data with templatefiles.
MixItRuby is a gem for mixing data (in form of a nested Hash) with templatefiles.

Example Use Case
----------------
You have to print bills for a list of items/products.
What you do :
Transform the data to a hash which lasts a specific form
Run mix with a erb template. Viola the output is (depending on the template)
ready to be formatted in latex of whatever.
Transform the data to a hash which lasts a specific form
Run mixit with an erb template. The output is (depending on the template)
ready to be formatted in latex of whatever.


Install
-------
gem install mixItRuby

run (form commandline)
run (from commandline)
-----------------------
mixit -i inputfile < -t templateDir -o outputfile >


run withing a programm
----------------------

require "mixer"
mixer = MIX::Mixer.new
mixer.mixItRuby(inputdata_hash)
mixer.writeResult2File(outputfile)


current project status
----------------------
Work in progress just started
Work in progress just started


You want to contributes ?
Expand All @@ -42,7 +47,7 @@ Contact [email protected]
Structure of the data
=====================

json Format recursive, selfcontained.
json, recursive, selfcontained.

recursive : substructures possible (nodes)
selfcontained : The name of the erb (id, for DB or File or whatever) is within the data
Expand All @@ -57,7 +62,7 @@ Here an example:
]
}

A building block consists of an id and other key value pair.
A building block consists of an id and other key value pairs.

id: is a must. It represents the identifier under which the template is accesible.
At the moment it is a filename. The other attributes on the same level, which are no array or hash are
Expand All @@ -69,13 +74,14 @@ Then an array follow. An Array must be build of hashes, which can have subarrays

What is mixItRuby needed for ?
==============================
With that little gem you can build up personalized letters or emails or html pages.
With that little gem you can build up personalized letters or emails or html pages, with nested data.
Just imagine the erb file are tex files or xml-fo or html files or they are files with are ruby file again, which produce some output.

Another possibility is create other json files. Imagine the template erbs are templates for json. Then for example in SOA business objects can be chained and enriched from services.

There are a lot of posibilities.

Post some it would be nice to hear what is possible.




Expand Down

0 comments on commit c77fca3

Please sign in to comment.