From 36505135b76a017fe8f39967cc4e7f4df9283263 Mon Sep 17 00:00:00 2001 From: Michalis Efstratiadis Date: Sat, 4 Oct 2025 10:42:06 +0300 Subject: [PATCH] Update version to 1.8.1 and enhance documentation for embedded views - Bump version in manifest.json to 1.8.1. - Add support for custom titles in both calendar and agenda views. - Update test-embedded-views.md to include examples of custom titles and improve clarity on usage. - Modify EmbeddedAgendaView and EmbeddedCalendarView to handle title parameters for better user customization. --- manifest.json | 2 +- src/views/EmbeddedAgendaView.ts | 8 +++++++- src/views/EmbeddedCalendarView.ts | 14 +++++++++---- test-embedded-views.md | 33 ++++++++++++++++++++++++++++++- versions.json | 4 +++- 5 files changed, 53 insertions(+), 8 deletions(-) diff --git a/manifest.json b/manifest.json index 9498b14..8a26e3d 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "memochron", "name": "MemoChron", - "version": "1.8.0", + "version": "1.8.1", "minAppVersion": "1.8.9", "description": "Calendar integration and note creation with support for public iCalendar URLs", "author": "Michalis Efstratiadis", diff --git a/src/views/EmbeddedAgendaView.ts b/src/views/EmbeddedAgendaView.ts index 40046a5..e76a4e4 100644 --- a/src/views/EmbeddedAgendaView.ts +++ b/src/views/EmbeddedAgendaView.ts @@ -18,6 +18,7 @@ export interface AgendaCodeBlockParams { days?: number; showPast?: boolean; showDailyNote?: boolean; + title?: string; } export class EmbeddedAgendaView extends MarkdownRenderChild { @@ -80,7 +81,9 @@ export class EmbeddedAgendaView extends MarkdownRenderChild { }); let headerText: string; - if (this.days === 1) { + if (this.params.title) { + headerText = this.params.title; + } else if (this.days === 1) { headerText = this.startDate.toLocaleDateString("default", { weekday: "long", month: "long", @@ -423,6 +426,9 @@ export function parseAgendaCodeBlock(source: string): AgendaCodeBlockParams { case "show-daily-note": params.showDailyNote = value.toLowerCase() === "true"; break; + case "title": + params.title = value; + break; } } diff --git a/src/views/EmbeddedCalendarView.ts b/src/views/EmbeddedCalendarView.ts index 68be649..228efd0 100644 --- a/src/views/EmbeddedCalendarView.ts +++ b/src/views/EmbeddedCalendarView.ts @@ -12,6 +12,7 @@ export interface CalendarCodeBlockParams { month?: string; year?: string; showDots?: boolean; + title?: string; } export class EmbeddedCalendarView extends MarkdownRenderChild { @@ -85,10 +86,12 @@ export class EmbeddedCalendarView extends MarkdownRenderChild { const title = header.createEl("h3", { cls: "memochron-embedded-title", - text: this.currentDate.toLocaleString("default", { - month: "long", - year: "numeric", - }), + text: + this.params.title || + this.currentDate.toLocaleString("default", { + month: "long", + year: "numeric", + }), }); // Create navigation @@ -259,6 +262,9 @@ export function parseCalendarCodeBlock( case "show-dots": params.showDots = value.toLowerCase() === "true"; break; + case "title": + params.title = value; + break; } } diff --git a/test-embedded-views.md b/test-embedded-views.md index 8bdfc0a..e6d48e7 100644 --- a/test-embedded-views.md +++ b/test-embedded-views.md @@ -5,12 +5,15 @@ This document demonstrates the new dataview-like functionality for MemoChron, al ## Calendar View Examples ### Current Month Calendar + Display the current month: ```memochron-calendar + ``` ### Specific Month Calendar + Display a specific month using different formats: ```memochron-calendar @@ -22,11 +25,13 @@ month: March 2025 ``` ### Navigation + The embedded calendar views include navigation buttons to browse between months and a "Today" button to return to the current month. ## Agenda View Examples ### Today's Agenda + Show today's events: ```memochron-agenda @@ -34,6 +39,7 @@ date: today ``` ### Specific Date Agenda + Show events for a specific date: ```memochron-agenda @@ -41,6 +47,7 @@ date: 2025-01-15 ``` ### Multiple Days Agenda + Show events for multiple days: ```memochron-agenda @@ -49,6 +56,7 @@ days: 7 ``` ### Tomorrow's Agenda + Show tomorrow's events: ```memochron-agenda @@ -56,6 +64,7 @@ date: tomorrow ``` ### Dynamic File-based Date + Use the current file's name as the date (useful for daily notes): ```memochron-agenda @@ -67,6 +76,7 @@ month: this.file.name ``` ### Week View with Daily Notes + Show a week of events including daily notes: ```memochron-agenda @@ -75,23 +85,43 @@ days: 7 show-daily-note: true ``` +### Custom Titles + +Both calendar and agenda views support custom titles: + +```memochron-calendar +title: My Project Calendar +month: 2025-02 +``` + +```memochron-agenda +title: This Week's Schedule +date: today +days: 7 +``` + ## Features 1. **Calendar View**: + - Month grid display with event indicators - Navigation between months - Click on dates to see event details - Supports color-coded calendars (if enabled in settings) - Shows daily note indicators + - Custom titles for personalized views 2. **Agenda View**: + - List view of events - Single or multi-day display - Shows event times, titles, and locations - Optional daily note entries - Click events to open/create notes + - Custom titles for personalized views 3. **Supported Date Formats**: + - `today`, `tomorrow`, `yesterday` - `YYYY-MM-DD` (e.g., 2025-01-15) - `YYYY-MM` or `YYYY/MM` for months @@ -109,10 +139,11 @@ show-daily-note: true ## Usage in Notes You can embed these views anywhere in your notes to: + - Track project timelines - Display weekly schedules - Show upcoming events in meeting notes - Create custom dashboards - Plan monthly goals -The embedded views automatically sync with your configured calendar sources and respect your MemoChron settings for colors, time formats, and other preferences. \ No newline at end of file +The embedded views automatically sync with your configured calendar sources and respect your MemoChron settings for colors, time formats, and other preferences. diff --git a/versions.json b/versions.json index 3a73e1b..c97e93a 100644 --- a/versions.json +++ b/versions.json @@ -26,5 +26,7 @@ "1.6.0": "1.8.9", "1.6.2": "1.8.9", "1.6.3": "1.8.9", - "1.7.0": "1.8.9" + "1.7.0": "1.8.9", + "1.8.0": "1.8.9", + "1.8.1": "1.8.9" }