This python script generates a basic HTML calendar page for a given year. The idea is that you can then edit the calendar with any editor (although some HTML knowledge is required to put your entries in the right place), and view your calendar with any browser. If you want to print it out, of course you can use your browser to do so. Links are provided to navigate to the previous and next years.
One advantage of this very simple format is that you're not tied to a specific application, and you can use tools like
grep to search through your calendar directory for any given text. Of course your own entries can contain any html you like.
Note that this script doesn't do any editing, it's only used for the generation of blank calendars.
The only file you need is this little python file: calendar.py. Because it's written in python, you also need a working python runtime installed already (either 2.* or 3.*).
You have to run this tool from the command line. The command to run it looks like this:
python calendar.py 2010 > 2010diary.html
This example generates the html output for the given year (2010) and redirects the output to a new file '2010diary.html'. You can then view this file in your browser (by double-clicking it), and you can edit it with any editor.
An example output for 2021 is given here, you can download this file and use it without even running the generator: 2021diary.html.
The output html contains a table for each month of the selected year. One day of this calendar looks like this:
<td><div class='date'> 8 </div></td>
This will be rendered like this:
<td><div class='date'> 8 </div> Bought a new <i>motorcycle</i>! </td>
And this will then be rendered in the page like this:
|Bought a new motorcycle!|
You can also use cell styles to highlight different types of day (weekends are already classified as 'dayoff'):
<td><div class='date'> 9 </div> Normal day </td> <td class="dayoff"><div class='date'> 10 </div> Weekend or other day off </td> <td class="holiday"><div class='date'> 11 </div> Holiday / Vacation </td>
|Normal day||Weekend or other day off||Holiday / Vacation|