Skip to content

Commit 5ff99e5

Browse files
committed
update readme (雑)
1 parent cf26ea9 commit 5ff99e5

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ Cloudflare Worker のビルドログとステータス表示が見れますが
154154

155155
## markdown仕様
156156

157+
実行環境の説明は ./packages/runtime/README.md を参照
158+
157159
````
158160
```言語名-repl
159161
>>> コマンド
@@ -162,9 +164,9 @@ Cloudflare Worker のビルドログとステータス表示が見れますが
162164
````
163165

164166
でターミナルを埋め込む。
165-
* ターミナル表示部は app/terminal/terminal.tsx
166-
* コマンド入力処理は app/terminal/repl.tsx
167-
* 各言語の実行環境は app/terminal/言語名/ 内に書く。
167+
* ターミナル表示部は ./packages/runtime/terminal.tsx
168+
* コマンド入力処理は ./packages/runtime/repl.tsx
169+
* 各言語の実行環境は ./packages/runtime/言語名/ 内に書く。
168170
* 実行結果はSectionContextにも送られ、section.tsxからアクセスできる
169171

170172
````
@@ -174,10 +176,10 @@ Cloudflare Worker のビルドログとステータス表示が見れますが
174176
````
175177

176178
でテキストエディターを埋め込む。
177-
* app/terminal/editor.tsx
179+
* ./packages/runtime/editor.tsx
178180
* editor.tsx内で `import "ace-builds/src-min-noconflict/mode-言語名";` を追加すればその言語に対応した色付けがされる。
179181
* importできる言語の一覧は https://github.com/ajaxorg/ace-builds/tree/master/src-noconflict
180-
* 編集した内容は app/terminal/file.tsx のFileContextで管理される。
182+
* 編集した内容は ./packages/runtime/file.tsx のFileContextで管理される。
181183
* 編集中のコードはFileContextに即時送られる
182184
* FileContextが書き換えられたら即時すべてのエディターに反映される
183185
* 編集したファイルの一覧はSectionContextにも送られ、section.tsxからアクセスできる
@@ -198,7 +200,7 @@ Cloudflare Worker のビルドログとステータス表示が見れますが
198200

199201
で実行ボタンを表示する
200202
* 実行ボタンを押した際にFileContextからファイルを読み、実行し、結果を表示する
201-
* app/terminal/exec.tsx に各言語ごとの実装を書く (それぞれ app/terminal/言語名/ 内に定義した関数を呼び出す)
203+
* ./packages/runtime/exec.tsx に各言語ごとの実装を書く (それぞれ ./packages/runtime/言語名/ 内に定義した関数を呼び出す)
202204
* 実行結果はSectionContextにも送られ、section.tsxからアクセスできる
203205

204206

packages/runtime/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# my.code(); Runtime API
22

3-
## runtime.tsx
3+
4+
## RuntimeContext (interface.ts)
45

56
各言語のランタイムはRuntimeContextインターフェースの実装を返すフックを実装する必要があります。
67

7-
runtime.tsx の `useRuntime(lang)` は各言語のフックを呼び出し、その中で指定された言語のランタイムを返します。
8+
context.tsx の `useRuntime(lang)` は各言語のフックを呼び出し、その中で指定された言語のランタイムを返します。
89

910
関数はすべてuseCallbackやuseMemoなどを用いレンダリングごとに同じインスタンスを返すように実装してください。
1011

@@ -63,6 +64,8 @@ runtime.tsx の `useRuntime(lang)` は各言語のフックを呼び出し、そ
6364
* getCommandlineStr: `(filenames: string[]) => string`
6465
* 指定されたファイルを実行するためのコマンドライン引数文字列を返します。表示用です。
6566
67+
## languages.ts
68+
6669
### LangConstant
6770
6871
言語ごとに固定の定数です。

0 commit comments

Comments
 (0)