Tag Archives: prawn

Dot Dot Dot… Grid?

I’ve been experimenting with notetaking with different types of paper lately.  I found the standard ruled paper stifling, yet blank pages are too intimidating. Graph paper feels a little more in-your-face, yet paradoxically, despite having more lines, seem less confining for writing English.

(For writing Chinese, the cases for graph paper and ruled paper are reversed.)

But the one style of paper I found most is liberating is dot grid.  The lightly-coloured and small dots offer a little bit of structure, while remain highly unobtrusive.

Unfortunately, dot grid paper or notebook is not half as easy to find as the other three types.  I experimented with some of the free graph paper generator online, but there is usually this ugly watermark I don’t want for paper I write on every day.  Besides, I want my paper to be 2-up on a US Letter size, since I want to be able to make a booklet out of the printed grids for easier carrying.

What’s a programmer to do?  Write a program, of course!

My first Google search with “Ruby” and “graph paper” led me to Prawn.  I ignored everything not related to generating a paper with dots in a square grid, then experimented with it.  [Github commit of 1-up dot grid]

A few iterations later, I found myself with a (slightly) more generalized collection of functions, allowing me to generate dots in both square and triangle grid, as well as ruled (both ways) and square grid graph — in any paper size and partitioned in any n-up way.  [Github commit of n-up dot grid] [Github commit with n-up ruled, graph, and triangle dot grid]

Heck, I even experimented with dot grid with the number of dots in Fibonacci sequence.  [Github commit with Fibonacci sequence]

As of that state, I it has all the core functionalities I wanted, but using it still require editing the script with the right parameters for the function calls — a clumsy way to use a program.

So, after a bit of code clean-up, I changed the script to use command line arguments and options.  Oh, and I added README.  [Github commit with command line options]

Now this is a tool I know I will continue to use, but only infrequently.  The rudimentary built-in help will be vital to refresh my mind the next time I use it.

Advertisements