fix(gitea): 寫入前先確認
This commit is contained in:
@@ -21,7 +21,7 @@ Different page types can live in different `{owner}/{repo}` repos, classified by
|
||||
| --- | --- |
|
||||
| list pages | `tools/gitea.sh wiki-list {owner}/{repo}` |
|
||||
| read page | `tools/gitea.sh wiki-get {owner}/{repo} {page}` (exit 4 when missing) |
|
||||
| write page | write the content to a temp file first, then `tools/gitea.sh wiki-put {owner}/{repo} {page} {file}` (creates or updates automatically) |
|
||||
| write page | 先寫入暫存檔,再呼叫 `tools/gitea.sh wiki-put {owner}/{repo} {page} {file}`(先確認,再建立或更新) |
|
||||
| page URL | `tools/gitea.sh wiki-url {owner}/{repo} {page}` — the page's absolute URL, taken from the API's `html_url` (exit 4 when the page is missing) |
|
||||
|
||||
When writing a page, link same-type pages with the `[[display|page]]` form (display text on the LEFT) and cross-type pages with the absolute URL from `wiki-url`, because `[[...]]` resolves only inside one wiki. Full rules and the direction trap: `references/wiki-links.md`.
|
||||
@@ -30,7 +30,7 @@ When writing a page, link same-type pages with the `[[display|page]]` form (disp
|
||||
|
||||
1. Page names must follow the wiki naming table in the skill guidelines (see `jsc-meta/references/guidelines.md`).
|
||||
2. Use `tools/hash-id` for `{HASH}` values. It returns the first 8 uppercase SHA-1 hex chars, or `H` plus the first 7 chars when the raw hash starts with `0-9`, `A`, `B`, or `C`.
|
||||
3. To update a contents page (`*_CONTENTS`): `wiki-get` it first, apply the template to append or modify, then `wiki-put` the whole page back. Never overwrite entries owned by others.
|
||||
3. To update a contents page (`*_CONTENTS`): `wiki-get` it first, apply the template to append or modify, then `wiki-put` the whole page back(寫入前會先確認)。不要覆寫別人的列。
|
||||
4. Write all wiki content in UTF-8 Traditional Chinese, per the STE100 output rule.
|
||||
5. Prefer visual forms for page content: use mermaid diagrams (flowchart, sequence, gantt, pie) and markdown tables wherever the information allows. Prose is capped at 3 sentences per section, and a sentence stays only when neither a mermaid diagram nor a markdown table can carry the same information.
|
||||
6. `tools/gitea.sh` retries once with the tea CLI login token when `GITEA_TOKEN` is missing or the response is 401/403. Report a failure only after that retry also fails.
|
||||
|
||||
Reference in New Issue
Block a user