Skip to content

Commit

Permalink
docs: update docs for qsu-web
Browse files Browse the repository at this point in the history
  • Loading branch information
jooy2 committed Dec 5, 2024
1 parent f2cf335 commit d95337c
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 4 deletions.
21 changes: 21 additions & 0 deletions docs/src/en/api/web.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,27 @@ order: 100

This method is only available in the `qsu-web` (JavaScript) package.

## `isMatchPathname`

You can check if the URL path in the first argument value is matched against the second set of rules. The matching rules can take a string or an array of strings, where both arguments are paths that start with `/`. You can use wildcards (`*`) in the rules. For example, `user/*` would match all pages that start with `/user`.

### Parameters

- `pathname::string`
- `matcher::string|string[]`

### Returns

> boolean
### Examples

```javascript
_.isMatchPathname('/user/login', '/admin'); // Returns false
_.isMatchPathname('/user/login', '/user*'); // Returns true
_.isMatchPathname('/user/login', ['/test', '/home/hello', '/user/*']); // Returns true
```

## `isBotAgent`

Analyze the user agent value to determine if it's a bot for a search engine. Returns `true` if it's a bot.
Expand Down
4 changes: 2 additions & 2 deletions docs/src/en/getting-started/installation-javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ $ pnpm install qsu-web # (Optional) When using the Add-on for Web

## How to Use

์ผ๋ฐ˜์ ์œผ๋กœ ๊ฐ๊ฐ์˜ ํ•จ์ˆ˜๋ฅผ ์•„๋ž˜์™€ ๊ฐ™์ด ๋ถ€๋ถ„์ ์œผ๋กœ importํ•˜์—ฌ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
In general, you can partially import and use each function as shown below.

```javascript
import { today, strCount } from 'qsu';
Expand All @@ -38,7 +38,7 @@ function main() {
}
```

์ฝ”๋“œ์™€ ๋ชจ๋“ˆ์˜ ๊ตฌ๋ถ„์„ ์œ„ํ•ด ์•„๋ž˜์ฒ˜๋Ÿผ ์–ธ๋”์Šค์ฝ”์–ด(`_`)๊ธฐํ˜ธ ๋“ฑ์„ ์‚ฌ์šฉํ•˜์—ฌ ๋ฉ”์†Œ๋“œ๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํŠน๋ณ„ํ•œ ๊ฒฝ์šฐ๊ฐ€ ์•„๋‹ˆ๋ฉด ๋ถ€๋ถ„ ๊ฐ€์ ธ์˜ค๊ธฐ๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.
You can use methods with underscore (`_`) symbols to separate code and modules, as shown below. We recommend using partial imports unless there are special cases.

```javascript
import * as _ from 'qsu';
Expand Down
21 changes: 21 additions & 0 deletions docs/src/ko/api/web.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,27 @@ order: 100

This method is only available in the `qsu-web` (JavaScript) package.

## `isMatchPathname`

์ฒ˜์Œ ์ธ์ž๊ฐ’์˜ URL ๊ฒฝ๋กœ๊ฐ€ ๋‘๋ฒˆ์งธ rule set์— ๋งค์นญ๋˜๋Š”์ง€ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋งค์นญ ๊ทœ์น™์€ string ๋˜๋Š” string์œผ๋กœ ๊ตฌ์„ฑ๋œ ๋ฐฐ์—ด์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ, ๋‘ ์ธ์ž ๋ชจ๋‘ ๊ฒฝ๋กœ๋Š” `/`์œผ๋กœ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค. ๊ทœ์น™์—๋Š” ์™€์ผ๋“œ์นด๋“œ(`*`)๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด `user/*`์ธ ๊ฒฝ์šฐ `/user`๋กœ ์‹œ์ž‘๋˜๋Š” ํŽ˜์ด์ง€๊ฐ€ ๋ชจ๋‘ ํ•ด๋‹น๋ฉ๋‹ˆ๋‹ค.

### Parameters

- `pathname::string`
- `matcher::string|string[]`

### Returns

> boolean
### Examples

```javascript
_.isMatchPathname('/user/login', '/admin'); // Returns false
_.isMatchPathname('/user/login', '/user*'); // Returns true
_.isMatchPathname('/user/login', ['/test', '/home/hello', '/user/*']); // Returns true
```

## `isBotAgent`

Analyze the user agent value to determine if it's a bot for a search engine. Returns `true` if it's a bot.
Expand Down
4 changes: 2 additions & 2 deletions docs/src/ko/getting-started/installation-javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ $ pnpm install qsu-web # (์„ ํƒ์ ) Web์šฉ ์ถ”๊ฐ€ ์œ ํ‹ธ์„ ์‚ฌ์šฉํ•  ๋•Œ

## ์‚ฌ์šฉ ๋ฐฉ๋ฒ•

In general, you can partially import and use each function as shown below.
์ผ๋ฐ˜์ ์œผ๋กœ ๊ฐ๊ฐ์˜ ํ•จ์ˆ˜๋ฅผ ์•„๋ž˜์™€ ๊ฐ™์ด ๋ถ€๋ถ„์ ์œผ๋กœ importํ•˜์—ฌ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

```javascript
import { today, strCount } from 'qsu';
Expand All @@ -38,7 +38,7 @@ function main() {
}
```

You can use methods with underscore (`_`) symbols to separate code and modules, as shown below. We recommend using partial imports unless there are special cases.
์ฝ”๋“œ์™€ ๋ชจ๋“ˆ์˜ ๊ตฌ๋ถ„์„ ์œ„ํ•ด ์•„๋ž˜์ฒ˜๋Ÿผ ์–ธ๋”์Šค์ฝ”์–ด(`_`)๊ธฐํ˜ธ ๋“ฑ์„ ์‚ฌ์šฉํ•˜์—ฌ ๋ฉ”์†Œ๋“œ๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํŠน๋ณ„ํ•œ ๊ฒฝ์šฐ๊ฐ€ ์•„๋‹ˆ๋ฉด ๋ถ€๋ถ„ ๊ฐ€์ ธ์˜ค๊ธฐ๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.

```javascript
import _ from 'qsu';
Expand Down

0 comments on commit d95337c

Please sign in to comment.