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

introduce how to install using cdn #45

Merged
merged 1 commit into from
Dec 22, 2023
Merged
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
39 changes: 19 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,24 @@ Try _KAL_ at [KAL Playground][playground].



## 🗡️ Installation

Load the interpreter script in HTML as follows:

```HTML
<script src="https://cdn.jsdelivr.net/gh/wcho21/kal@latest/dist/index.min.js"></script>
```

After that, you can execute _KAL_ code with `kal.execute(code-to-execute)` as follows:

```HTML
<script>
kal.execute("5+5"); // === 10
</script>
```



## 🗡️ Examples

### Statements and expressions
Expand Down Expand Up @@ -91,9 +109,8 @@ _Boolean type_: `참`, `거짓`
```


## 🗡️ Manual building and installation

### How to build
## 🗡️ Building

Note that building process is based on [Node.js][node].

Expand All @@ -103,21 +120,3 @@ The output will be in the directory `/bundle/index.js`.

[pnpm]: https://pnpm.io/
[node]: https://nodejs.org/



### How to use in browsers

Put the bundled file `index.js` (see above) in your directory, and load the file in HTML as following:

```HTML
<script src="/your-directory/index.js"></script>
```

After that, you can execute _KAL_ code with `kal.execute(code-to-execute)` as follows:

```HTML
<script>
kal.execute("5+5"); // === 10
</script>
```
38 changes: 20 additions & 18 deletions docs/README_KR.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,24 @@ _KAL_ 을 [플레이그라운드][playground]에서 체험해보세요.



## 브라우저에서 사용하기

다음과 같이 인터프리터 스크립트를 HTML 상에서 로드합니다.

```HTML
<script src="https://cdn.jsdelivr.net/gh/wcho21/kal@latest/dist/index.min.js"></script>
```

이후, _KAL_ 코드는 다음과 같이 `kal.execute(code-to-execute)`로 실행합니다.

```HTML
<script>
kal.execute("5+5"); // === 10
</script>
```



## 🗡️ 예시

### 문법들
Expand Down Expand Up @@ -91,6 +109,7 @@ _불리언 타입_: `참`, `거짓`
```



## 🗡️ 빌드와 설치

### 빌드하기
Expand All @@ -104,25 +123,8 @@ pnpm install && pnpm build && pnpm bundle`
```



결과는 `/bundle/index.js` 디렉토리에 위치합니다.

[pnpm]: https://pnpm.io/
[node]: https://nodejs.org/



### 브라우저에서 사용하기

빌드한 파일 `index.js`를 원하는 디렉토리에 놓고, 다음과 같이 HTML 상에서 로드합니다.

```HTML
<script src="/your-directory/index.js"></script>
```

이후, _KAL_ 코드는 다음과 같이 `kal.execute(code-to-execute)`로 실행합니다.

```HTML
<script>
kal.execute("5+5"); // === 10
</script>
```