Calendar Extension Ideas

I don’t expect I’ll add this to TaskPaper, but I’ve been thinking of a calendar system to test Bike 2’s extension system. I wonder if these ideas could fit in?

Calendar

I think Bike is a great place for a notes calendar.

I expect to represent the calendar in Bike using a Year > Month > Day hierarchy. Similar to what is done by this today script.

One important point is that the calendar structure is created dynamically as needed. We don’t create a row for every possible day, but when a day is asked for we insert a row in the proper location. Then you can add notes for the day under that row.

First command for this calendar system is a “Today” command that creates a row for today (if needed) and then moves the selection to that row.

Bike 2 extensions can also present HTML views as a sheet over the outline view.I think this adds an interesting new dimension to Bike. For example the extension could add a sidebar “Calendar” item. When clicked it will show a traditional looking calendar in an HTML sheet overlay. Select a day in that calendar and the sheet will dismiss and you’ll be taken to that day’s row in your outline.

I think this would be a pretty nice daily notes calendar. But it doesn’t support events/reminders/recurrences.

Events/Reminders/Recurrences

I think for most use cases these really need to be stored in the standard macOS calendar database. Then they show up on all your calendars and beep when overdue on your phone, etc.

An extension (with some added API in my part) could integrate Bike’s notes calendar with the macOS calendar database in various ways. For example when you move text selection into a day on your Bike notes calendar the extension could query the calendar database for events on that day and then display them in inspector bar. To make this work I will need to add extension API for querying calendar database, but wouldn’t be too hard to do I think.

Would this work for your use case?

Templates

Another thing that could be done, and that works a little more like the TaskPaper template you’ve linked too…

Come up with a convention for template items. Store those items in your outline somewhere and then when the notes calendar creates a new day part of that “new day” code could be to search your outline for templates that land on that day and insert them too. So for example in your outline somewhere you have:

  • Template: Mondays / Take out the garbage

And then when you navigate to “Today” and it hasn’t been created yet, and it’s a Monday, then “Take out the garbage” is inserted into the new day row.

Thoughts/ideas welcome.

1 Like

I’ve just created a first version of the notes calendar extension.

You can find it here:

Requires Bike 2 Preview (224)

To install you will need to copy the extension folder that you want into the extensions folder. That can be revealed by menu Bike > Extensions.

Once installed you should see “Today” in sidebar. Click today and it should generate the follow calendar structure:

It’s a start. Bike’s extension API is still a moving target. Bike 2 is still a work in progress. But if you manage to get it to work might help you see how it feels and make suggestions one how it might work in the end.

2 Likes

quick reply on one point. I do find it useful to generate multiple whole months’ worth of dates, which i fold in TP when i don’t need to see them. This lets me see how crowded a given month is getting.

For me, an important part of planning is to schedule ongoing tasks (e.g. reading the scientific literature) that otherwise would get pushed aside by the crush of daily tasks. Having all the days listed lets me do that.

thus, i would rather not have this (or have it only as an option):

One important point is that the calendar structure is created dynamically as needed. We don’t create a row for every possible day, but when a day is asked for we insert a row in the proper location. Then you can add notes for the day under that row.

as it happens, i don’t really integrate my calendar with my to do list. i use my calendar for appointments (classes to teach, meetings), and i just manually write appointments into my to do list. So if there is a way to pull calendar entries into Bike, that would be convenient (slightly different from what you describe below)

An extension (with some added API in my part) could integrate Bike’s notes calendar with the macOS calendar database in various ways. For example when you move text selection into a day on your Bike notes calendar the extension could query the calendar database for events on that day and then display them in inspector bar. To make this work I will need to add extension API for querying calendar database, but wouldn’t be too hard to do I think.

it looks like this could be quite useful (e.g. scheduling workout days)

Templates

Another thing that could be done, and that works a little more like the TaskPaper template you’ve linked too…

Come up with a convention for template items. Store those items in your outline somewhere and then when the notes calendar creates a new day part of that “new day” code could be to search your outline for templates that land on that day and insert them too. So for example in your outline somewhere you have:

I think that would be an easy tweak to make to this system.

Add an extra command “Calendar: Month” which just loops through and generates everyday of the month using the same generate day logic. Does that do it?

yes, that would do it. i usually keep about 6 future months on TP, so i would need this feature to be able create multiple consecutive months.

I’ve just pushed a new version that adds “Month” and “Year” commands.

Recurrence templates shouldn’t be too hard I think, but I am waiting on some extension build system work so that I can easily import existing javascript code that supports recurrences.

A nice thing about this calendar that isn’t possible in pure plain text outline is that the logic is ID based, meaning you can format as you wish without breaking the calendar logic.

For example if you think the top level calendar should be renamed, or the days should have a different heading–you can make those changes and everything will still work.

Another nice thing is that when it inserts rows for date it keeps them in order relative to existing rows. So if you start by clicking the Today sidebar item and typing “Hello!” you’ll get:

Calendar
	2025
		May, 2025
			May 07, 2025
				Hello!

If you later decide that you want the entire month the missing days will be inserted in appropriate order. Leaving the May 7 “Hello!” note in place.

i’ve downloaded Bike2 for the first time and installed the calendar.bikeextension folder. i get the following, which i cannot turn into an outline. what am i not doing?

Sorry about that, you need to:

Choose menu item Window > Themes > Bike (Standard)

Themes are in state of flux as they move from old specialized system and into Bike extension system. And as a result I have been just ignoring this bug.

i don’t see the month and year commands, although i downloaded the latest github

Those should be available through the Command Bar (Command-Shift-P). Do you see them there?

okay, got it. i assume that in the future, Day, Month and Year will appear as commands in the menu bar?

also, i guess you know this, the black arrows don’t respond to the cursor, although i can use the keyboard commands to expand and collapse

I use the Calendar:Year command to create all the months for the current year 2025, but how do i create months for 2026?

Good, glad you have the basics working.

First I’m just throwing this extension out as an idea/prototype. Wondering if this core is something that you could use. Or that might spark ideas. Unless I hear otherwise I think the core is good.

Now for making it work for your use case.

okay, got it. i assume that in the future, Day, Month and Year will appear as commands in the menu bar?

They could, but I’m not sure if I would want that by default. Seems you will be generating year and even month not so often? That’s why I left them to just show in Command Bar. For me I would rather only have buttons that I use often in the sidebar.

I use the Calendar:Year command to create all the months for the current year 2025, but how do i create months for 2026?

No way yet, but you could hack it…


If you look in the extension see src/main.ts. Open that in a text editor and find the line:

let yearRow = getOrCreateCalendarYearRow(outline, new Date(), true, true);

and replace it with:

let yearRow = getOrCreateCalendarYearRow(outline, new Date('2026-05-08'), true, true);

Save (Bike will reload logic automatically), and then invoke the generate year command and you’ll get 2026. Then (if you want) undo your change so year works normally again.

Even if you are not a programmer I “think” you might be able to see the patterns in that file and make edits to achieve what you want. For example to create a new Month sidebar item you could add this:

window.sidebar.addItem({
  id: "calendar:month",
  text: "Month",
  symbol: "calendar",
  ordering: { section: "actions" },
  action: "calendar:month",
});

I’m still busy building out the extension system at this point, so I don’t think I’m ready to polish this extension much further right now, but ideas are welcome. One possible way to implement your ideas in a better way would be:

When you click sidebar “Calendar” item it shows a standard calendar UI widget in a sheet over the editor. Click a date in that calendar and the sheet will close and the chosen date will get inserted and selected in your outline. So that allows you to select any date.

Change the current Month/Year commands so the they work relative to the selected date in the calendar. Maybe rename them to “Fill Month Dates”, “Fill Year Dates”? So to generate year 2026 you would:

  1. Navigate to a date in 2026 using Calendar sheet UI
  2. Command-P and choose “Fill Year Dates”

thanks. looking good. and i’ve never written any type/javascript before, but i can at least copy and paste.

this is all nicely promising, and the only thing i can think of for the future is to add some theme formatting to the calendar so that it is easy to differentiate the text under each of the dates. Combined with your idea of a function to automatically pull in calendar items, i could just live inside of Bike 2.

Looks good!

i’ve never written any type/javascript before, but i can at least copy and paste.

This is the Hog Bay Software AI play. Create a core outline app with extension API. Allow non-coding users to generate custom extension features with AI. Maybe!?

That theming should be pretty strait forward. I don’t recommend digging into themes quite yet, I’m changing some things, but before too long we can test in that direction too.

1 Like