- TODO: Box and image/svg element types
- TODO: Layout logic
Clone this repo! (gem install
coming soon, maybe)
Usage: ludoc [options]
-l=layout yaml layout file (required)
-i=input csv input file (required)
-o=output output path for pdf file (default output is to stdout)
e.g., in a clone of this repo:
./bin/ludoc -l=lib/layouts/playing_card.yml -i=test.csv -o=output.pdf
A layout is a YAML file (example here) specifying the format of an individual game piece and the overall format of the end result PDF.
units
: eitherinches
orpoints
(1 inch = 72 points)width
: width of an individual game piece (in inches or points)height
: height of an individual game piece (in inches or points)orientation
: eitherportrait
orlandscape
rows
: number of rows of game pieces on a single pagecolumns
: number of columns of game pieces on a single pagecount_column
(optional): the name of the input column which contains the number for how many times a game piece should be repeatedelements
: an array of elements to be rendered
type
:text
align
: specifyleft
,right
, orcenter
text-alignmentcolumn
: the name of the input column which contains the text for this elementbox
: text box measurements in the following formatleft top width height
with the preferred units, e.g.1" 0.5" 1.5" 2.5"
would define a 1.5" wide by 2.5" tall text box 1" from the left and 0.5" from the top of the game piece
An input file is a CSV that is combined with a layout to create game pieces. Input files define the actual pieces in your game.
The first row of an input file specifies the column names, the remaining row contains game piece data.
Here's an input file describing chess pieces:
Name,Color,Point Value,Count
Pawn,white,1,8
Knight,white,3,2
Bishop,white,3,2
Rook,white,5,2
Queen,white,9,1
King,white,0,1
Pawn,black,1,8
Knight,black,3,2
Bishop,black,3,2
Rook,black,5,2
Queen,black,9,1
King,black,0,1
- Fork it ( https://github.com/modality/ludoc/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request