mirror of
https://github.com/formax68/memoChron.git
synced 2026-07-22 05:45:44 +00:00
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.
This commit is contained in:
parent
2e6b09ebb7
commit
36505135b7
5 changed files with 53 additions and 8 deletions
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
The embedded views automatically sync with your configured calendar sources and respect your MemoChron settings for colors, time formats, and other preferences.
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue