Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ushitora-anqou committed Sep 28, 2023
1 parent d722be8 commit 5fb115f
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ Qash は複式簿記と呼ばれる簿記法に基づいて設計されていま
読者として、基本的な Linux コマンドの使い方やエディタの使い方を知っていることを想定しています。
複式簿記の知識は不要です。

### 基本編

Qash では全ての取引を**勘定科目**の間のお金の動きとして表現します。
ここで勘定科目とはお金を区別するためのラベルで、
例えば「現金」「xxx銀行普通預金」「立替金」「開始残高」「yyyクレジットカード」「食費」「給与」などを指します。
Expand Down Expand Up @@ -228,9 +226,9 @@ $ _build/default/bin/main.exe serve root.qash
<kbd><img src="img/handson-2.png" /></kbd>
<kbd><img src="img/handson-3.png" /></kbd>

### 応用編
## Tips

#### JSON データを取り込む
### JSON データを取り込む

普段の買い物を現金ではなくクレジットカードやデビットカードで行っている場合、
Qash のプログラムを手打ちする代わりに、
Expand Down Expand Up @@ -288,7 +286,7 @@ Qash の `of-json` サブコマンドを使います。
]
```

#### 別ファイルに書いた Qash プログラムを読み込む
### 別ファイルに書いた Qash プログラムを読み込む

`!import "..."` 命令を使うことで別ファイルに記述されている
Qash プログラムを取り込んで扱うことができます。
Expand Down Expand Up @@ -328,7 +326,7 @@ Qash プログラムを `!import` で取り込むときに便利です。
そのたびに書き換えを行うのも面倒です。そこで変換後のファイルには手を付けず
上書きして使うことでこの問題を回避できます。

#### `!show``!assert` 命令で家計簿をテストする
### `!show``!assert` 命令で家計簿をテストする

Qash のバックエンドは SQLite3 です。
`!show "..."` 命令を使うことでこのバックエンドに SQL クエリを発行し結果を確認できます。
Expand Down Expand Up @@ -386,4 +384,14 @@ Error: Assertion failed: SELECT balance = 23001 FROM '現金' LIMIT 1
なお、SQL クエリのデバッグなどには `dump` サブコマンドで SQLite3 ファイルを出力させ、
これを `sqlite3` コマンドなどで直接叩くのが便利です。

(WIP)
### GitHub Actions を使って、Qash-FE を Cloudflare Pages にデプロイする

Qash FE は `pnpm run build` することで静的なサイトになるので、
これと Qash が生成する data.json を合わせて Cloudflare Pages でホストすることで、
サーバをローカルで起動せずとも Web UI を見ることができます。
Cloudflare Access を使ってアクセス制限をかけることで、
限られた人だけがページを見られるようにすることもできます。

上記の流れを GitHub Actions として設定しておくと、Qash プログラムを push する
だけでデプロイされるため、非常に便利です。例えば[この workflow](https://gist.github.com/ushitora-anqou/628add264694cd24f7eed6f149dab07c)などを
参照してください。

0 comments on commit 5fb115f

Please sign in to comment.