Skip to content

Commit a75d2e0

Browse files
committed
readme
1 parent 61fd739 commit a75d2e0

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,56 @@ npm run lint
2929
```
3030
でコードをチェックします。出てくるwarningやerrorはできるだけ直しましょう。
3131

32+
## markdown仕様
33+
34+
````
35+
```言語名-repl
36+
>>> コマンド
37+
実行結果例
38+
```
39+
````
40+
41+
でターミナルを埋め込む。
42+
* ターミナル表示部は app/terminal/terminal.tsx
43+
* コマンド入力処理は app/terminal/repl.tsx
44+
* 各言語の実行環境は app/terminal/言語名/ 内に書く。
45+
* 実行結果はSectionContextにも送られ、section.tsxからアクセスできる
46+
47+
````
48+
```言語名:ファイル名
49+
ファイルの内容
50+
```
51+
````
52+
53+
でテキストエディターを埋め込む。
54+
* app/terminal/editor.tsx
55+
* editor.tsx内で `import "ace-builds/src-min-noconflict/mode-言語名";` を追加すればその言語に対応した色付けがされる。
56+
* importできる言語の一覧は https://github.com/ajaxorg/ace-builds/tree/master/src-noconflict
57+
* 編集した内容は app/terminal/file.tsx のFileContextで管理される。
58+
* 編集中のコードはFileContextに即時送られる
59+
* FileContextが書き換えられたら即時すべてのエディターに反映される
60+
* 編集したファイルの一覧はSectionContextにも送られ、section.tsxからアクセスできる
61+
62+
````
63+
```言語名-readonly:ファイル名
64+
ファイルの内容
65+
```
66+
````
67+
68+
で同様にテキストエディターを埋め込むが、編集不可になる
69+
70+
````
71+
```言語名-exec:ファイル名
72+
実行結果例
73+
```
74+
````
75+
76+
で実行ボタンを表示する
77+
* 実行ボタンを押した際にFileContextからファイルを読み、実行し、結果を表示する
78+
* app/terminal/exec.tsx に各言語ごとの実装を書く (それぞれ app/terminal/言語名/ 内に定義した関数を呼び出す)
79+
* 実行結果はSectionContextにも送られ、section.tsxからアクセスできる
80+
81+
3282
## 技術スタック・ドキュメント・メモ
3383

3484
- [Next.js](https://nextjs.org/docs)

0 commit comments

Comments
 (0)