Planning Files on Demand
Markdown Week Planner Generator
A C# console application that creates a Markdown note for every working day of a chosen period, sorted into folders by year, month and calendar week.
Overview
The Week Planner Generator is a C# console program. For a chosen period, it creates a folder structure with a Markdown note for every working day.
Features
- Start month and number of months are entered at startup
- Folders for year, month and calendar week are created automatically
- One Markdown file per day, Monday to Friday
- A template with placeholders for the date and the weekday
- Calendar weeks according to ISO 8601
- Storage location and template in a JSON configuration
- Existing files are never overwritten
Problem
Planning your week in Markdown files means creating folders and files by hand again and again and copying the same template. It is repetitive, and calendar weeks are easy to get wrong.
Solution
After the start month and the number of months are entered, the program creates the folders for each month, works out the weeks and writes one file per day from Monday to Friday from the template, with the date and weekday already filled in. Where a file already exists, it is left unchanged.
Technical implementation
The settings are read into a Settings class of their own with System.Text.Json. Dates are calculated with DateTime, and ISOWeek.GetWeekOfYear provides the calendar week. Folders are created with Directory.CreateDirectory, which simply accepts existing ones. Before writing, File.Exists checks whether a file is already there.
Challenges
The week logic was the tricky part: the program looks for the first Monday of the month, moves on week by week from there and stops at the end of the month, even mid-week. Calendar weeks follow ISO 8601 so the numbers match common calendars, including around the turn of the year.
Limitations
Working days before the first Monday of a month get no file. Input is not validated, so a wrong format ends the program with an error. The paths are written for Windows.
Lessons learned
This section is still to be written.
Screenshots
A command-line program without a graphical interface. There are no screenshots of its output yet.