Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Japanese doc in V2 #53

Open
wants to merge 24 commits into
base: v2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
sandbox
.env
node_modules
docs/vitepress/cache
docs/.vitepress/cache
2 changes: 1 addition & 1 deletion README.md
3 changes: 2 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"singleQuote": false,
"useTabs": true,
"exclude": [
"./docs/"
"./docs/docs/",
"./docs/ja/"
]
},
"imports": {
Expand Down
143 changes: 113 additions & 30 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,125 @@ export default defineConfig({
sitemap: {
hostname: "https://linejs.evex.land",
},
locales: {
root: {
label: "English",
lang: "en",
link: "/",
themeConfig: {
nav: [
{ text: "Home", link: "/" },
{ text: "Docs", link: "/docs/start" },
{
text: "Examples",
link: "https://github.com/evex-dev/linejs/tree/main/examples",
},
],
},
},
ja: {
label: "日本語",
lang: "ja",
link: "/ja",
themeConfig: {
nav: [
{ text: "ホーム", link: "/ja/" },
{ text: "ドキュメント", link: "/ja/docs/start" },
{
text: "サンプル",
link: "https://github.com/evex-dev/linejs/tree/main/examples",
},
],
docFooter: {
prev: "前のページ",
next: "次のページ",
},
darkModeSwitchLabel: "切り替え",
darkModeSwitchTitle: "ダークモードにする",
lightModeSwitchTitle: "ライトモードにする",
sidebarMenuLabel: "メニュー",
langMenuLabel: "言語を選択",
outlineTitle: "ページ内",
returnToTopLabel: "トップに戻る",
skipToContentLabel: "コンテンツをスキップ",
},
},
},
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
siteTitle: "LINEJS Docs",
search: {
provider: "local",
},

nav: [
{ text: "Home", link: "/" },
{ text: "Docs", link: "/docs/start" },
{
text: "Examples",
link: "https://github.com/evex-dev/linejs/tree/main/examples",
options: {
locales: {
ja: {
translations: {
button: {
buttonText: "検索",
buttonAriaLabel: "検索",
},
modal: {
displayDetails: "詳細を表示",
resetButtonTitle: "検索をリセット",
backButtonTitle: "検索を閉じる",
noResultsText: "結果が見つかりません",
footer: {
selectText: "決定",
selectKeyAriaLabel: "入力",
navigateText: "移動",
navigateUpKeyAriaLabel: "上矢印",
navigateDownKeyAriaLabel: "下矢印",
closeText: "閉じる",
closeKeyAriaLabel: "esc",
},
},
},
},
},
},
],

sidebar: [
{
text: "Docs",
items: [
{ text: "Getting Started", link: "/docs/start" },
{ text: "Next Steps", link: "/docs/start-2" },
{ text: "Message Event", link: "/docs/message-event" },
{ text: "Client Options", link: "/docs/client-options" },
// { text: "Utils", link: "/docs/utils" },
{ text: "Client Methods", link: "/docs/methods" },
],
},
{
text: "Guides",
items: [
{ text: "Authors", link: "/docs/authors" },
{ text: "Question", link: "/docs/question" },
],
},
],
},
sidebar: {
"/docs/": [
{
text: "Docs",
items: [
{ text: "Getting Started", link: "/docs/start" },
{ text: "Next Steps", link: "/docs/start-2" },
{ text: "Message Event", link: "/docs/message-event" },
{ text: "Client Options", link: "/docs/client-options" },
// { text: "Utils", link: "/docs/utils" },
{ text: "Client Methods", link: "/docs/methods" },
],
},
{
text: "Guides",
items: [
{ text: "Authors", link: "/docs/authors" },
{ text: "Question", link: "/docs/question" },
],
},
],
"/ja/docs/": [
{
text: "ドキュメント",
items: [
{ text: "はじめに", link: "/ja/docs/start" },
{ text: "次のステップ", link: "/ja/docs/start-2" },
{ text: "メッセージイベント", link: "/ja/docs/message-event" },
{ text: "クライアントのオプション", link: "/ja/docs/client-options" },
// { text: "ユーティリティ", link: "/ja/docs/utils" },
{ text: "メソッド", link: "/ja/docs/methods" },
],
},
{
text: "ガイド",
items: [
{ text: "作成者", link: "/ja/docs/authors" },
{ text: "お問い合わせ", link: "/ja/docs/question" },
],
},
],
},

editLink: {
pattern: "https://github.com/evex-dev/linejs/edit/main/docs/:path",
Expand Down
119 changes: 59 additions & 60 deletions docs/.vitepress/theme/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* Each colors have exact same color scale system with 3 levels of solid
* colors with different brightness, and 1 soft color.
*
*
* - `XXX-1`: The most solid color used mainly for colored text. It must
* satisfy the contrast ratio against when used on top of `XXX-soft`.
*
Expand Down Expand Up @@ -43,97 +43,96 @@
* in custom container, badges, etc.
* -------------------------------------------------------------------------- */

:root {
--vp-c-default-1: var(--vp-c-gray-1);
--vp-c-default-2: var(--vp-c-gray-2);
--vp-c-default-3: var(--vp-c-gray-3);
--vp-c-default-soft: var(--vp-c-gray-soft);

--vp-c-brand-1: var(--vp-c-indigo-1);
--vp-c-brand-2: var(--vp-c-indigo-2);
--vp-c-brand-3: var(--vp-c-indigo-3);
--vp-c-brand-soft: var(--vp-c-indigo-soft);

--vp-c-tip-1: var(--vp-c-brand-1);
--vp-c-tip-2: var(--vp-c-brand-2);
--vp-c-tip-3: var(--vp-c-brand-3);
--vp-c-tip-soft: var(--vp-c-brand-soft);

--vp-c-warning-1: var(--vp-c-yellow-1);
--vp-c-warning-2: var(--vp-c-yellow-2);
--vp-c-warning-3: var(--vp-c-yellow-3);
--vp-c-warning-soft: var(--vp-c-yellow-soft);

--vp-c-danger-1: var(--vp-c-red-1);
--vp-c-danger-2: var(--vp-c-red-2);
--vp-c-danger-3: var(--vp-c-red-3);
--vp-c-danger-soft: var(--vp-c-red-soft);
:root {
--vp-c-default-1: var(--vp-c-gray-1);
--vp-c-default-2: var(--vp-c-gray-2);
--vp-c-default-3: var(--vp-c-gray-3);
--vp-c-default-soft: var(--vp-c-gray-soft);

--vp-c-brand-1: var(--vp-c-indigo-1);
--vp-c-brand-2: var(--vp-c-indigo-2);
--vp-c-brand-3: var(--vp-c-indigo-3);
--vp-c-brand-soft: var(--vp-c-indigo-soft);

--vp-c-tip-1: var(--vp-c-brand-1);
--vp-c-tip-2: var(--vp-c-brand-2);
--vp-c-tip-3: var(--vp-c-brand-3);
--vp-c-tip-soft: var(--vp-c-brand-soft);

--vp-c-warning-1: var(--vp-c-yellow-1);
--vp-c-warning-2: var(--vp-c-yellow-2);
--vp-c-warning-3: var(--vp-c-yellow-3);
--vp-c-warning-soft: var(--vp-c-yellow-soft);

--vp-c-danger-1: var(--vp-c-red-1);
--vp-c-danger-2: var(--vp-c-red-2);
--vp-c-danger-3: var(--vp-c-red-3);
--vp-c-danger-soft: var(--vp-c-red-soft);
}

/**
* Component: Button
* -------------------------------------------------------------------------- */

:root {
--vp-button-brand-border: transparent;
--vp-button-brand-text: var(--vp-c-white);
--vp-button-brand-bg: #006200;
--vp-button-brand-hover-border: transparent;
--vp-button-brand-hover-text: var(--vp-c-white);
--vp-button-brand-hover-bg: #076907;
--vp-button-brand-active-border: transparent;
--vp-button-brand-active-text: var(--vp-c-white);
--vp-button-brand-active-bg: #479947;
--vp-button-brand-border: transparent;
--vp-button-brand-text: var(--vp-c-white);
--vp-button-brand-bg: #006200;
--vp-button-brand-hover-border: transparent;
--vp-button-brand-hover-text: var(--vp-c-white);
--vp-button-brand-hover-bg: #076907;
--vp-button-brand-active-border: transparent;
--vp-button-brand-active-text: var(--vp-c-white);
--vp-button-brand-active-bg: #479947;
}

/**
* Component: Home
* -------------------------------------------------------------------------- */

:root {
--vp-home-hero-name-color: transparent;
--vp-home-hero-name-background: -webkit-linear-gradient(
120deg,
#41d1ff 30%,
#00B900
);

--vp-home-hero-image-background-image: linear-gradient(
-45deg,
#ffB9ff 50%,
#69dbff 50%
);
--vp-home-hero-image-filter: blur(45px);
--vp-home-hero-name-color: transparent;
--vp-home-hero-name-background: -webkit-linear-gradient(
120deg,
#41d1ff 30%,
#00b900
);

--vp-home-hero-image-background-image: linear-gradient(
-45deg,
#ffb9ff 50%,
#69dbff 50%
);
--vp-home-hero-image-filter: blur(45px);
}

@media (min-width: 640px) {
:root {
--vp-home-hero-image-filter: blur(56px);
}
:root {
--vp-home-hero-image-filter: blur(56px);
}
}

@media (min-width: 960px) {
:root {
--vp-home-hero-image-filter: blur(68px);
}
:root {
--vp-home-hero-image-filter: blur(68px);
}
}

/**
* Component: Custom Block
* -------------------------------------------------------------------------- */

:root {
--vp-custom-block-tip-border: transparent;
--vp-custom-block-tip-text: var(--vp-c-text-1);
--vp-custom-block-tip-bg: var(--vp-c-brand-soft);
--vp-custom-block-tip-code-bg: var(--vp-c-brand-soft);
--vp-custom-block-tip-border: transparent;
--vp-custom-block-tip-text: var(--vp-c-text-1);
--vp-custom-block-tip-bg: var(--vp-c-brand-soft);
--vp-custom-block-tip-code-bg: var(--vp-c-brand-soft);
}

/**
* Component: Algolia
* -------------------------------------------------------------------------- */

.DocSearch {
--docsearch-primary-color: var(--vp-c-brand-1) !important;
--docsearch-primary-color: var(--vp-c-brand-1) !important;
}

14 changes: 9 additions & 5 deletions docs/docs/message-event.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
The next step is to finally receive the message.\
The atmosphere is becoming more and more like a bot!

:::warning Note, however, that to receive the group's message, the decrypt key
in `FileStorage` or so on, as described in [Start 2](/docs/start-2). :::
:::warning
however, that to receive the group's message, the decrypt key
in `FileStorage` or so on, as described in [Start 2](/docs/start-2).
:::

First, let's create a bot that only receives “!ping” and returns “pong!”.

Expand Down Expand Up @@ -48,7 +50,7 @@ client.on("message", (message) => {
const text = message.text;

if (text === "!ping") {
...
...
}
});
```
Expand Down Expand Up @@ -104,5 +106,7 @@ There are many more features!

Stay tuned for our next journey.

:::tip If you encounter problems, please refer to [Question](/docs/question),
not only here. :::
:::tip
If you encounter problems, please refer to [Question](/docs/question),
not only here.
:::
10 changes: 6 additions & 4 deletions docs/docs/start-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,13 @@ This concludes our first trip.\
But there is still a journey left to be made.\
Enjoy.

:::tip\
:::tip
If you want to create your own storage such as connecting to the cloud api,\
import `BaseStorage` and extend it to create your own storage. (Please ask for
details.) :::
details.)
:::

:::info\
:::info
If you want to use v1, please ask for details at
[discord.gg/evex](https://discord.gg/evex). :::
[discord.gg/evex](https://discord.gg/evex).
:::
3 changes: 2 additions & 1 deletion docs/docs/start.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,5 @@ console.log(chats[0].name)

This library is still in its infancy!\
If you find <i>any bugs</i> or <i>missing parts</i>, please let us know on our
server! (Roles will be given to those who suggest bugs and features!)
server! \
(Roles will be given to those who suggest bugs and features!)
Loading
Loading