What:新增 html-export 與 html-style 兩支技能、tools/html-render.sh 與 tools/html-style.sh 兩支工具,以及六種版型乘五種風格的 HTML 範本。 Why:wiki 頁與議題要拿給 Gitea 以外的人看時,只能複製 markdown;不同類型的文件也該有各自的版面,不是每份都長一樣。 How:版型(report、slide、dashboard、spec、timeline、onepager)決定內容怎麼排,風格(minimal、corporate、dark、print、vivid)決定看起來長怎樣,兩者自由搭配。哪一種頁面套哪一組由設定決定:專案的 .jsc/html-styles 優先,其次 $JSC_HOME/html-styles.conf,對不到退 DEFAULT,再對不到才用內建的 report/minimal。產出是單一 HTML 檔,CSS 與腳本全部內嵌。 Who:需要把 wiki 頁或議題寄給客戶、主管或跨團隊同事的人。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
3.7 KiB
3.7 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. 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]. Exit 4 means the name is not one of the listed templates — go back to step 2 or 3 rather than editing the 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.