Browse Source

chore: docs

yaavi 8 months ago
parent
commit
e9394c4c94

+ 1 - 0
docs/.vitepress/en.ts

@@ -41,6 +41,7 @@ function sidebarGuide(): DefaultTheme.SidebarItem[] {
       collapsed: false,
       collapsed: false,
       items: [
       items: [
         { text: 'What is Chinese Days', link: 'what-is-chinese-days' },
         { text: 'What is Chinese Days', link: 'what-is-chinese-days' },
+        { text: 'iCal Subscription', link: 'ical-subscription' },
         { text: 'Getting started', link: 'getting-started' },
         { text: 'Getting started', link: 'getting-started' },
       ]
       ]
     },
     },

+ 2 - 1
docs/.vitepress/zh.ts

@@ -64,7 +64,8 @@ function sidebarGuide(): DefaultTheme.SidebarItem[] {
       text: '简介',
       text: '简介',
       collapsed: false,
       collapsed: false,
       items: [
       items: [
-        { text: 'Chinese Days', link: 'what-is-chinese-days' },
+        { text: '关于本项目', link: 'what-is-chinese-days' },
+        { text: '日历订阅', link: 'ical-subscription' },
         { text: '快速开始', link: 'getting-started' },
         { text: '快速开始', link: 'getting-started' },
       ]
       ]
     },
     },

+ 0 - 0
docs/en/guide/ical-subscription.md


+ 10 - 1
docs/zh/guide/getting-started.md

@@ -1,6 +1,12 @@
 # 快速开始
 # 快速开始
 
 
-本文档内容主要针对 `JS` 和 `TS` 开发用户,使用其他语言请参考 [开发](/guide/what-is-chinese-days#非-js-语言)。
+本文档内容主要针对 `JS` 和 `TS` 开发用户。
+
+::: info 提示
+使用其他语言开发,请参考 [关于本项目](/guide/what-is-chinese-days#非-js-语言) 部分内容。
+
+此外还支持 `iCal` 文件 [订阅节假日](/guide/ical-subscription),可供 Google Calendar、Apple Calendar、Microsoft Outlook 等客户端订阅。
+:::
 
 
 ## 推荐方式
 ## 推荐方式
 
 
@@ -55,5 +61,8 @@ console.log(isHoliday('2020-01-01'));
 
 
 ```
 ```
 https://cdn.jsdelivr.net/npm/chinese-days@1.4.0
 https://cdn.jsdelivr.net/npm/chinese-days@1.4.0
+```
+
+```
 https://esm.run/chinese-days@1.4.0
 https://esm.run/chinese-days@1.4.0
 ```
 ```

+ 3 - 1
docs/zh/guide/holidays.md

@@ -10,7 +10,9 @@ console.log(isHoliday('2023-01-01')); // true
 
 
 接收起始日期和结束日期,并可选地决定是否包括周末。如果包括周末,则函数会返回包括周末在内的所有节假日;否则,只返回工作日的节假日。
 接收起始日期和结束日期,并可选地决定是否包括周末。如果包括周末,则函数会返回包括周末在内的所有节假日;否则,只返回工作日的节假日。
 
 
-> tip: 即使不包括周末,周末的节假日仍然会被返回
+::: info 提示
+即使不包括周末,周末的节假日仍然会被返回
+:::
 
 
 ```js
 ```js
 // 示例用法
 // 示例用法

+ 15 - 0
docs/zh/guide/ical-subscription.md

@@ -0,0 +1,15 @@
+# 日历订阅
+
+在 Google Calendar、Apple Calendar、Microsoft Outlook 等客户端中,可以设置订阅地址来获取日历订阅。
+
+订阅的日历包含近三年(2023-2025年)的节假日和调休日。
+
+中文订阅地址:
+```
+https://cdn.jsdelivr.net/npm/chinese-days/dist/holidays.ics
+```
+
+英文订阅地址: 
+```
+https://cdn.jsdelivr.net/npm/chinese-days/dist/holidays.en.ics
+```

+ 5 - 9
docs/zh/guide/what-is-chinese-days.md

@@ -14,17 +14,13 @@
 
 
 ## 非 `JS` 语言
 ## 非 `JS` 语言
 
 
-如果你不使用 `JS` 或 `TS` 开发项目,本项目提供了中国节假日的 `JSON` 文件,通过链接 [chinese-days.json](https://cdn.jsdelivr.net/npm/chinese-days/dist/chinese-days.json) 可以直接引用。
+如果你不使用 `JS` 或 `TS` 开发项目,本项目提供了中国节假日的 [chinese-days.json](https://cdn.jsdelivr.net/npm/chinese-days/dist/chinese-days.json) 文件,可以通过下面的 CDN 链接进行使用。
 
 
-比如在 `Java` 中使用,可以参考 [Warnier-zhang/java-chinese-days](https://github.com/Warnier-zhang/java-chinese-days),仅用于查询中国节假日、调休日、工作日;
+```
+https://cdn.jsdelivr.net/npm/chinese-days/dist/chinese-days.json
+```
 
 
-## 日历订阅
-
-在 Google Calendar、Apple Calendar、Microsoft Outlook 等客户端中,可以设置订阅地址:[https://cdn.jsdelivr.net/npm/chinese-days/dist/holidays.ics](https://cdn.jsdelivr.net/npm/chinese-days/dist/holidays.ics) 来获取日历订阅。
-
-For English: [https://cdn.jsdelivr.net/npm/chinese-days/dist/holidays.en.ics](https://cdn.jsdelivr.net/npm/chinese-days/dist/holidays.en.ics)
-
-订阅的日历包含近三年(2023-2025年)的节假日和调休日。
+比如在 `Java` 中使用,可以参考 [Warnier-zhang/java-chinese-days](https://github.com/Warnier-zhang/java-chinese-days),仅用于查询中国节假日、调休日、工作日。
 
 
 ## 许可信息
 ## 许可信息