Browse Source

chore: docs

yaavi 8 months ago
parent
commit
8f8b49c901

+ 68 - 0
docs/en/guide/getting-started.md

@@ -0,0 +1,68 @@
+# Quick Start
+
+This documentation is primarily intended for users developing in `JS` and `TS`.
+
+::: info Note
+For other programming languages, please refer to the section on [Non-JS Languages](/en/guide/what-is-chinese-days.html#non-js-languages).
+
+Additionally, the project supports `iCal` file [holiday subscriptions](/en/guide/ical-subscription), compatible with clients such as Google Calendar, Apple Calendar, and Microsoft Outlook.
+:::
+
+## Recommended Usage
+
+Directly include the library in the browser for the most up-to-date version:
+
+```html
+<!-- Include the script -->
+<script src="https://cdn.jsdelivr.net/npm/chinese-days"></script>
+
+<!-- Use the library -->
+<script>
+  chineseDays.isHoliday('2024-01-01');
+  // Or use destructuring
+  const { isHoliday } = chineseDays;
+</script>
+```
+
+Alternatively, use `type="module"` with ESM:
+
+```html
+<script type="module">
+  import chineseDays from 'https://esm.run/chinese-days';
+  // Use the library after importing
+  chineseDays.isHoliday('2024-01-01');
+</script>
+```
+
+## Installation
+
+```sh
+npm i chinese-days
+```
+
+Using ESM import:
+
+```ts
+import chineseDays from 'chinese-days';
+console.log(chineseDays);
+```
+
+Using in Node.js:
+
+```js
+const { isWorkday, isHoliday } = require('chinese-days');
+console.log(isWorkday('2020-01-01'));
+console.log(isHoliday('2020-01-01'));
+```
+
+## Specifying a Version
+
+It is generally not recommended to specify a version, as holidays are updated based on announcements from the State Council. If you must specify a version, you can refer to [jsdelivr](https://www.jsdelivr.com/), for example:
+
+```
+https://cdn.jsdelivr.net/npm/chinese-days@1.4.0
+```
+
+```
+https://esm.run/chinese-days@1.4.0
+```

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

@@ -0,0 +1,15 @@
+# Calendar Subscription
+
+You can set up a subscription URL in clients such as Google Calendar, Apple Calendar, or Microsoft Outlook to access holiday calendars.
+
+The subscribed calendar includes holidays and adjusted working days for the upcoming three years (2023–2025).
+
+### English Subscription URL: 
+```
+https://cdn.jsdelivr.net/npm/chinese-days/dist/holidays.en.ics
+```
+
+### Chinese Subscription URL:
+```
+https://cdn.jsdelivr.net/npm/chinese-days/dist/holidays.ics
+```

+ 27 - 0
docs/en/guide/what-is-chinese-days.md

@@ -0,0 +1,27 @@
+# What is Chinese Days
+
+## Introduction
+
+This project provides a collection of functions for querying Chinese holidays, adjusted working days, regular workdays, the 24 solar terms, and converting between the lunar and solar calendars. Additionally, it supports subscribing to holiday calendars in `iCal` format, which can be integrated with clients such as Google Calendar, Apple Calendar, and Microsoft Outlook.
+
+Data is automatically fetched daily through `GitHub Actions`. Notifications are sent via email when there are changes to holiday schedules, and information is updated based on announcements from the State Council.
+
++ **Holidays**: Covers the years from 2004 to 2025, including the extended Spring Festival in 2020.
++ **24 Solar Terms**: Supports dates from 1900 to 2100.
++ **Lunar Calendar**: Supports dates from 1900 to 2100.
+
+The project primarily targets `JS` and `TS` users. Refer to the documentation for usage instructions.
+
+## Non-`JS` Languages
+
+If you are not developing projects in `JS` or `TS`, this project provides a [chinese-days.json](https://cdn.jsdelivr.net/npm/chinese-days/dist/chinese-days.json) file for Chinese holidays. You can use the following CDN link:
+
+```
+https://cdn.jsdelivr.net/npm/chinese-days/dist/chinese-days.json
+```
+
+For example, in `Java`, you can refer to [Warnier-zhang/java-chinese-days](https://github.com/Warnier-zhang/java-chinese-days), which is designed solely for querying Chinese holidays, adjusted working days, and regular workdays.
+
+## License Information
+
+Released under the MIT License.