Month Calendar macro
MoinMoin is great for storing semantically linked stuff, but there was no easy way to access and browse calendar related data yet.
So if you want to use MoinMoin as PIM (Personal Information Manager), you need calendar access and calendar wiki integration (just calling a cgi web calendar is not enough for the Wiki way).
put MonthCalendar.py into your macro directory (if the name is ...moin-13.py, rename it)
follow the directions at top of MonthCalendar.py and change some of your MoinMoin config / css / translation files
Then put a macro call like the ones you see below on your pages:
[[MonthCalendar]] gives you the current month's calendar for your current page and looks like this:
<< < 2022 / 6 > >> Mon Tue Wed Thu Fri Sat Sun 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
[[MonthCalendar(OtherUser,,,-1)]] gives you the previous month's calendar for page "OtherUser" and looks like that:
<< < 2021 / 5 > >>
Mon Tue Wed Thu Fri Sat Sun 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Please use this one for moin 1.3.x: MacroMarket/MonthCalendar-moin13.py
Please use this one for moin 1.2.x: MacroMarket/MonthCalendar-moin12.py
For moin 1.1 and older: MacroMarket/MonthCalendar.py
If you have questions, problems, bug reports, wishes, comments - put them here:
I've got MonthCalendar installed and it looks great. But I wonder if it's quite the right tool for what I'm trying to do. I'm running a wiki for a university course, and I wanted to include a schedule of course events and other stuff.
Does each page have its own calendar? Yes. At least, that is the default - see also next answer.
So if I want to have a centralized calendar, I use the [[MonthCalendar(CentralCalendarPage]] notation? Yes. Or you just jump to that page and view the calendar there.
And is there a way to get something displayed within the month calendar - like a brief description of the event? No. I thought about that, but abandoned that idea for monthcalendar due to limited screen space. It might be a good idea for week or day calendars, but I think it is just too much for a square month calendar. But you maybe could write a macro including first line of all pages matched by a regex and use Page/2003-..-.. as regex. That would maybe do the job quite good. Hmm, if I get some time, I'll write such a beast, so maybe just wait a few days... ;) [How would I get access to the month and day parameters so that I could have this include stuff, for example, all "events" headings, for the current day, the current week, or the current month into the page below where the monthly calendar sits? -bryan]
- This is a great module! I had one problem tho... the move forward/back month/year buttons did not work with pages that had spaces in the page title. I don't know Python, so there may be a better way to do this... but I fixed it by changing
querystr = "calparms=%s,%d,%d,%d,%%d" % (string.join(parmpagename,'*'), parmyear, parmmonth, parmoffset)
querystr = "calparms=%s,%d,%d,%d,%%d" % (string.join(parmpagename,'*').replace(' ', '_20'), parmyear, parmmonth, parmoffset)
and adding the following line to parseargs after the first if/else statement
parmpagename = parmpagename.replace('_20', ' ')
- I ran into problems customizing the look of the calendar because some of the generated table options are in the code (at the end), not in the css, like most of the other options. Had to change it there.
Modified the version above to run with moin--main--1.2 and did a lot of style and logic changes and clarifications. Take a look at it on OliverGraf/MonthCalendar
- This is on purpose. If you want to change the second calendar, first go to it by clicking on its name in the title area.
- Ok, that's good to know, thanks!
MonthCalendar also only works if allow_extened_names is true. Otherwise the links are not picked up as valid wiki links. JosYule
- Where do I put the style sheet stuff with the new themes? I don't seem to have a default.css or moinmoin.css...
- it is called screen.css since a while
There are now two versions of MonthCalendar for MoinMoin 1.2. The one mentioned at the top, MonthCalendar-moin12.py, and the one by Oliver Graf. They are rendered differently, I don't know which to prefer. But the one by Oliver Graf has an important feature that is missing in the 'default' one: if you have three month tables with monthoffset +0,+1,+2, changing the month of one calendar will move all calendars. If you come to some default version, this feature should definitely be included.
-- PeterKleiweg 2004-08-11 13:07:56
I have created my own version as well, (based off of OliverGraf/MonthCalendar ) It can be found at JonathanDietrich/AnnualMonthlyCalendar It includes Annual Calendars (no year specified), useful for birthdays, holidays, and anniversaries.
see also AdventCalendar
The MonthCalendar works well. However, the content of the pages which I added through the calendar can not be search by the moinmoin search engine. Is that its design or my setting is wrong?
- Works for me. Try to add a page using the calendar above and reproduce the bug.