Skip to content

Calendar Generation#42

Draft
ClarissaMilligan wants to merge 12 commits into
mainfrom
cm-calendar
Draft

Calendar Generation#42
ClarissaMilligan wants to merge 12 commits into
mainfrom
cm-calendar

Conversation

@ClarissaMilligan

Copy link
Copy Markdown
Collaborator

Overview

I made a tool to generate calendars for the semester based on how I was using canva for this in the past. It is in a separate file called calendars.typ.

How to Use

  • There is currently only one function that the user needs called header (woops I forgot to change this name...need to do that)
  • Required parameters are:
    • A "month-range" array in the format: (numeric-starting-month, numeric-ending-month)
    • A "day-range" array in the format: (numeric-day-to-start-on, numeric-day-to-end-on). The start day will be the day the calendar starts the first week on and the end day is the day it will end a week on
  • This is what the output could look like with just these parameters in place:
image

Features

  • You can add a title to the calendar:
image
  • You can control whether or not it is a leap year and whether or not you want to start weeks on a Monday
#calendars.header(
    (2, 3),
    (23, 21),
    title: "CS-1181 FA26",
    is-leap-year: true,
    is-mon-start: true,
)
image
  • You can add arrays of dates and a color to shade the dates in on the calendar. This can be used to gray out holidays or red out finals week or whatever your heart desires
#let gray-out = (
    (9, 7),
)

#let red-out = (
    (8, 24),
)

#let gray-encodings = (gray-out, gray)
#let red-encodings = (red-out, rgb("#f59998"))

#let shadings = (
    gray-encodings,
    red-encodings
)

#calendars.header(
    (8, 9),
    (23, 19),
    title: "CS-1181 FA26",
    shading: shadings
)
image
  • You can add a list of dates and a string for the assignment/event
  • You can also provide keywords and colors to highlight text
#let colors = (
    ("zyBooks", rgb("#10a178")),
    ("lab", rgb("#104fa1")),
    ("project", rgb("#a19e10")),
    ("QUIZ", rgb("#a15d10")),
    ("exam", rgb("#a11010")),
    ("FINAL", rgb("#a11010")),
    ("MIDTERM", rgb("#a11010")),
)

#let dates = (
    (8, 30, "zyBooks #1"),
    (9, 6, "zyBooks #2"),
    (9, 13, "zyBooks #3"),

    (8, 30, "lab #1"),
    (9, 6, "lab #2"),
    (9, 13, "lab #3"),

    (9, 13, "project #1"),

    (9, 18, "QUIZ #1"),
)

#calendars.header(
    (8, 9),
    (23, 19),
    title: "CS-1181 FA26",
    color-codes: colors,
    due-dates: dates
)
image
  • Full mock-up of a semester
image

Fix/Add

  • Center the "week #" text better (I CANNOT figure this out)
  • Rename main function
  • Add more assertions
  • Add comments for the functions
  • Add ability to put a week overview text over the week
  • Add function to help generate arrays of dates?

@ClarissaMilligan ClarissaMilligan self-assigned this Jul 24, 2026
@ClarissaMilligan ClarissaMilligan added the enhancement New feature or request label Jul 24, 2026
@ReeseHatfield

ReeseHatfield commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator
  • The import will need to be added to lib.typ
  • I really like the approach of "heres a basic calendar, now add what you want to it"
  • I'm a little confused about what there is an init and header. I believe show => rules as we used them, are meant for like initializing a set of edited rules for a document. Maybe a calendar function, that accepts a header call as its first argument might be more ituitive
  • I personally am TERRIBLE with month numbers. I would greatly appreciate a lexical to numerical enum in the module
  • Other than that, no notes. This is super cool and I really like it. I think it will go super well, if we add like syllabus stuff in the next major update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants