From 4cb69b6e8038aed9500a54d8ad05c70fce283abd Mon Sep 17 00:00:00 2001 From: mousebomb Date: Tue, 4 Nov 2025 11:11:00 +0800 Subject: [PATCH] =?UTF-8?q?readme=E6=96=87=E6=A1=A3=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 22 ++++++++++++++++++++-- README_zh.md | 19 +++++++++++++++++-- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0ff9ae8..573fddc 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ https://github.com/user-attachments/assets/5cca303c-9c91-4805-ad37-8213e5124f62 - The plugin parses Obsidian's diary note files (usually Markdown files named by date) - Extracts primary or secondary level headings (configured by the user) - Each extracted heading becomes a calendar entry corresponding to the date in the filename +- If the heading contains time (HH:mm), it will be parsed and used as the event start time. If no time is found, the event will be considered as an all-day event. ### Calendar Entry Details Each calendar entry (event) will contain: @@ -33,6 +34,18 @@ Each calendar entry (event) will contain: If the diary has frontmatter fields, the plugin concatenates the day's frontmatter into a text output as an additional event. By default, each property is displayed on a separate line as the event description. Custom rules can be edited, for example: `weather:{{weather}} mood:{{mood}}` to extract weather and mood properties from frontmatter. +If you don't know frontmatter, you can refer to the [official documentation](https://help.obsidian.md/Properties) for more information. + + +### Time Parsing Rules +- If the heading contains time (HH:mm) or time range (HH:mm~HH:mm), it will be parsed and used as the event start time. +- If no time is found, the event will be considered as an all-day event. + +Examples of titles that can be parsed: +- `## 10:00~12:00 Team Meeting` will be parsed as a meeting from 10:00 to 12:00 +- `## Team Meeting 10:00` will be parsed as a meeting from 10:00 to 11:00 (default end time is 1 hour after start time) +- `## Outdoor Walk` will be parsed as an all-day event + ## Example Explanation @@ -50,15 +63,20 @@ Assume you have a diary file: `2025-05-14.md` with the following content: ## Afternoon Tasks - Meet with team to discuss requirements + +## Evening Tasks 19:00 +- Dinner with friends + ``` If the user sets the plugin to extract all secondary level headings: -The plugin will extract two calendar entries: +The plugin will extract 3 calendar entries: - Event 1: Title "Morning Tasks", description includes "Plan with R&D", link to the diary - Event 2: Title "Afternoon Tasks", description is empty, link to the diary +- Event 3: Title "Evening Tasks", description is empty, link to the diary, time is 19:00-20:00 -After subscribing to `http://127.0.0.1:99347/feed.ics` in the system calendar, you can see these two events. +After subscribing to `http://127.0.0.1:99347/feed.ics` in the system calendar, you can see these three events. ## Usage Instructions diff --git a/README_zh.md b/README_zh.md index 0def5c9..07f6b91 100644 --- a/README_zh.md +++ b/README_zh.md @@ -17,6 +17,7 @@ https://github.com/user-attachments/assets/7ceeb379-d0cf-450b-a368-7cbc77a09b8a - 插件会解析Obsidian中的日记笔记文件(通常是按日期命名的Markdown文件) - 从这些文件中提取出一级或二级标题(由用户配置) - 每个提取出的标题将作为一条日历条目,对应当天(即文件名中的日期) +- 如果标题中包含了时间(HH:mm)则把时间填充到生成的ics事件中,如果标题中没有时间的话则保持原样看作全天事件。 ### 日历条目详情 每个日历条目(事件)将包含以下内容: @@ -31,7 +32,15 @@ https://github.com/user-attachments/assets/7ceeb379-d0cf-450b-a368-7cbc77a09b8a 如果日记有属性(frontmatter)字段,则把当天日记的frontmatter 拼接成文字 输出为一个额外日程。 默认就是一行一个属性作为日程描述。 允许自行编写规则,如可以编辑:天气:{{weather}} 心情:{{mood}} 表示从frontmatter里提取当天的天气和心情属性。 +如果你不了解frontmatter,可以先参考[Obsidian的官方文档](https://help.obsidian.md/Properties)。 +### 时间解析规则 +如果用户在写日记文档的标题中包含了时间(HH:mm)或者时间范围(HH:mm~HH:mm)则把时间填充到生成的ics事件中,如果标题中没有时间的话则保持原样(看作全天事件)。 + +例如: +- `## 10:00~12:00 团队会议` 会被解析为 10:00-12:00 的会议事件 +- `## 10:00 团队会议` 会被解析为 10:00-11:00 的会议事件(默认结束时间为开始时间的1小时后) +- `## 户外郊游` 会被解析为全天事件 ## 示例说明 @@ -49,16 +58,22 @@ https://github.com/user-attachments/assets/7ceeb379-d0cf-450b-a368-7cbc77a09b8a ## 下午任务 - 与团队开会讨论需求 + +## 下班后聚餐 19:00 +- 和团队成员聚餐 + ``` 用户在插件设置中设置了提取所有二级标题。 -则,插件会提取出两个日历条目: +则,插件会提取出3个日历条目: - 事件1:标题为“上午任务”,备注中包含"和研发制定计划",链接可跳转到日记 - 事件2:标题为“下午任务”,备注为空,链接可跳转到日记 +- 事件3:标题为“下班后聚餐”,在日历上的时间为19:00-20:00,备注为空,链接可跳转到日记 + +系统日历订阅了 `http://127.0.0.1:99347/feed.ics` 后,就能看到这3个事件。 -系统日历订阅了 `http://127.0.0.1:99347/feed.ics` 后,就能看到这两个事件。 ## 使用方法