by Matt Gemmell
It's a Ruby script that outputs a monthly calendar, like the cal
command in Unix, but with more control over the output format.
Just Ruby itself.
It generates a monospaced monthly calendar for the command-line, like the cal
command, but its output can be customised to produce any textual format you like, such as HTML.
Options include specifying the month and/or year, the starting day of the week and how many days to show per week, and whether to generate calendars for a single month, a sequence of three months, or an entire year.
It can use an external configuration file to extensively customise how it renders its output. An example configuration file is included, which will produce an HTML/CSS calendar. It also provides for highlighting the current day, week, and month in a manner of your choosing.
That's about it.
Just do ruby calendar.rb
on the command-line.
You can use the -h
switch to learn about a few useful options.
The script sends output to Standard Output, which you can of course redirect to wherever you'd like. For example, to send the calendar to a file called mycal.txt
, you can do ruby calendar.rb > mycal.txt
.
You can customise the script's behaviour via the configuration file, and command-line options. You shouldn't need to change anything in the script itself.
That thing you were hoping it did. Any non-Gregorian calendar formats. And anything I've not explicitly said that it does do.
Matt Gemmell (that's me).
-
My website is at mattgemmell.com
-
I'm on Twitter as @mattgemmell
-
This code is on github at github.com/mattgemmell/Calendar
Creative Commons Attribution-Sharealike.
If you need a difference license, feel free to ask.
Partly for fun, and partly because the output from cal
was too inflexible (and visually cramped) for my taste. I also really wanted the ability to highlight the current day, week, and/or month, and to generate an HTML version of the calendar if necessary.
I know there are presumably a million such scripts. Now there are a million and one.
Nope. If you find a bug, please fix it and submit a pull request via github.
Feel free to create an issue with your idea.
You can:
-
Check out my Amazon wishlist.
-
Say thanks on Twitter, I suppose.