技能以前只寫成功路徑。腳本回非 0 時,模型得自己猜下一步,猜錯就是靜靜 往下走。現在每一支腳本在檔頭宣告自己的結束碼,技能也逐碼寫明要停、要 問、還是要改參數再呼叫一次。兩支技能補上連線變數的解析步驟,讓缺值在 第一步就浮出來,而不是在中途撞出一行英文錯誤。 流程也拉平了。取內容、選範本、問輸出位置這幾件事彼此不相依,改成同一批 送出;存取庫批次同步從逐一處理改成各存取庫同時進行,一個 owner 底下有 上百個存取庫時差距最明顯。 相依的技能組下限寫進外掛設定,版本推進。
4.3 KiB
4.3 KiB
name, description
| name | description |
|---|---|
| html-style | Set which HTML layout and style a kind of Gitea wiki page or issue gets when jsc-gitea:html-export renders it. Offer all six layouts from tools/html-style.sh layouts and all five styles from tools/html-style.sh styles as decision-tree options per jsc-ask, then write the pair with tools/html-style.sh set - either to the project file .jsc/html-styles or to the global $JSC_HOME/html-styles.conf. Use when a kind of page or issue should come out looking different, or when the export reported source builtin or default; not for rendering a page, which is jsc-gitea:html-export. |
html-style — which template a kind of page gets
One kind of page, one layout, one style. jsc-gitea:html-export reads what this skill writes.
Steps
- Settle the kind key. Show the current configuration with
tools/html-style.sh listfirst, then ask perjsc-ask:askrules which kind this run sets. The three shapes are fixed:WIKI:{page-name prefix}(WIKI:PLAN,WIKI:ANALYZE,WIKI:LOG…),ISSUE:{label name}(ISSUE:bug), andDEFAULTfor everything that matches nothing else. Every option states its impact scope —DEFAULTchanges every kind that has no row of its own. Completion condition: exactly one key is agreed, and its current value fromtools/html-style.sh get {key}has been read back with its source column. - Pick the layout — offer all six. Run
tools/html-style.sh layouts; it prints each name with its Traditional Chinese description, taken from the template file itself.list,get,layoutsandstylesexit 2 on a usage error — fix the arguments and call again. An empty listing means the template directory is missing, which stops this skill: report the path rather than offering a name the export cannot use. Present all six as options perjsc-ask:askrules, each with what it does to the content (reportbuilds a table of contents beside the text,slideturns every##into a keyboard-flipped page,dashboardturns them into cards,specfreezes table headers,timelinestrings them along a line,onepagernarrows everything into one printable page). Completion condition: the user has picked one layout name that the script listed. - Pick the style — offer all five. Run
tools/html-style.sh stylesand present every one it prints (minimal,corporate,dark,print,vivid) with its description. Never trim the list to a shortlist: the point of this skill is that the user sees the whole set. Completion condition: the user has picked one style name that the script listed. - Pick the scope. Ask per
jsc-ask:askrules:--projectwrites./.jsc/html-styles, which only applies inside this working directory and is committed with the repository;--globalwrites$JSC_HOME/html-styles.conf, which follows the user across every project on this machine. State that the project file wins whenever both hold the same key. Completion condition: the user has picked one scope. - Write it:
tools/html-style.sh set {key} {layout} {style} [--project|--global]. Route every exit code: 0 → the file it printed now holds the pair; 1 → the settings file's directory could not be created, so report the path and stop, since nothing was written; 2 → a usage error, such as a missing name or a scope flag that is neither--projectnor--global, so fix the arguments and call again; 4 → the layout or style name has no template file, so go back to step 2 or step 3 rather than editing the settings file by hand. Completion condition: the script exits 0 and prints the file it wrote. - Read it back with
tools/html-style.sh get {key}and report the resolved layout, style and source. Completion condition: the source column showsprojectorglobal, matching the scope chosen in step 4.
Rules
- Only names the script listed may be written. A key holding a template that does not exist fails at export time, long after the mistake was made.
- Removing a row is
tools/html-style.sh unset {key} [--project|--global]; after that the kind falls back toDEFAULT, then to the built-inreport/minimal. - New layouts live in
templates/html/layout/{name}.htmland new styles intemplates/html/style/{name}.css, each starting with a one-line Traditional Chinese comment — that comment is what the option list shows.