diff --git a/AGENTS.md b/AGENTS.md index 0f4f6bd..fd01583 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -10,8 +10,8 @@ always work. Proxmox tools: `therepos/proxmox`; MCP servers: `therepos/mcp`; Cla (knowledge-base stages `kbprofile`, `kbrcm`, `kbbundle`; plan in `apps/kbplan.md`). - `scripts/` (repo helpers, never run by users): `sync-blocks.sh` shared blocks, `lint.sh` checks and safe fixes, `docgen-pages.py` the script page (therepos.github.io/windows, built and deployed by CI). -- Script page: title `Windows Scripts`, one row per script (name, purpose, button: `Copy command` or `Download .`, - one width), repo link in the footer. +- Script page: title `Windows Scripts`, one row per script (name, purpose, icon buttons: copy command for + bootstrap scripts, download for every script; hover text `Copy command` / `Download .`), GitHub icon link in the footer. Each script needs a display name in `NAMES` in `docgen-pages.py` (lint checks): Title Case words split at word boundaries, acronyms in caps (`KB RCM`, `SMB Cache`, `Add-in Setup`). diff --git a/scripts/docgen-pages.py b/scripts/docgen-pages.py index 7e3a1de..b2c07da 100755 --- a/scripts/docgen-pages.py +++ b/scripts/docgen-pages.py @@ -43,6 +43,28 @@ 'zipper': 'Zipper', } +# Inline icons (Lucide copy/download/check, GitHub mark), stroke/fill from currentColor +ICON_COPY = '' +ICON_DOWNLOAD = '' +ICON_CHECK = '' +ICON_GITHUB = ('') + +def actions(filename, cmd): + # the file is served from the page itself, so the browser downloads it instead of showing text + os.makedirs(os.path.join(OUT_DIR, 'apps'), exist_ok=True) + shutil.copy(os.path.join('apps', filename), os.path.join(OUT_DIR, 'apps', filename)) + copy = (''.format( + html.escape(cmd, quote=True), ICON_COPY) if cmd else '') + label = 'Download ' + os.path.splitext(filename)[1] + download = '{2}'.format( + html.escape(filename, quote=True), label, ICON_DOWNLOAD) + return '
{}{}
'.format(copy, download) + def scripts(): return [f for f in sorted(os.listdir('apps')) if os.path.splitext(f)[1] in KINDS] @@ -69,13 +91,7 @@ def html_rows(run_by_command): is_cmd = l1.startswith('# irm ') if is_cmd != run_by_command: continue - if is_cmd: - button = ''.format(html.escape(l1[2:], quote=True)) - else: - # served from the page itself, so the browser downloads it instead of showing text - os.makedirs(os.path.join(OUT_DIR, 'apps'), exist_ok=True) - shutil.copy(os.path.join('apps', filename), os.path.join(OUT_DIR, 'apps', filename)) - button = 'Download {}'.format(html.escape(filename, quote=True), ext) + button = actions(filename, l1[2:] if is_cmd else '') rows.append(row(name, purpose, button)) return '\n'.join(rows) @@ -95,16 +111,22 @@ def html_rows(run_by_command): .hint{color:var(--muted);margin:0 0 1rem} input{width:100%;box-sizing:border-box;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:var(--card);color:var(--text);font-size:15px} .list{background:var(--card);border:1px solid var(--line);border-radius:12px;overflow:hidden} -.row{display:grid;grid-template-columns:180px 1fr 140px;gap:4px 16px;align-items:center;padding:10px 14px;border-top:1px solid var(--line)} +.row{display:grid;grid-template-columns:180px 1fr auto;gap:4px 16px;align-items:center;padding:10px 14px;border-top:1px solid var(--line)} .row:first-child{border-top:0} .row b{font-weight:600} .row p{margin:0;color:var(--muted);font-size:14px} -button,.btn{box-sizing:border-box;width:100%;padding:7px;text-align:center;text-decoration:none;display:block;border:1px solid var(--line);border-radius:8px;background:transparent;color:var(--text);font-size:14px;cursor:pointer} -button:hover,.btn:hover{background:var(--bg)} -button.done{color:var(--ok);border-color:var(--ok)} -footer{margin-top:2.5rem;padding-top:1rem;border-top:1px solid var(--line);color:var(--muted);font-size:14px} -footer a{color:inherit} -@media (max-width:640px){.row{grid-template-columns:1fr 140px}.row p{grid-column:1/-1;grid-row:2}} +.act{display:flex;gap:6px} +.ic{box-sizing:border-box;width:36px;height:36px;display:grid;place-items:center;padding:0;border:1px solid var(--line);border-radius:8px;background:transparent;color:var(--text);cursor:pointer} +.ic:hover{background:var(--bg)} +.ic.blank{border:0;cursor:default} +.ic.done{color:var(--ok);border-color:var(--ok)} +.ic svg,.hint svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round} +.hint svg{width:15px;height:15px;vertical-align:-2px} +footer{margin-top:2.5rem;padding-top:1rem;border-top:1px solid var(--line);display:flex;justify-content:center} +footer a{display:inline-flex;align-items:center;gap:8px;color:var(--muted);text-decoration:none;font-size:14px} +footer a:hover{color:var(--text)} +.gh{width:18px;height:18px;fill:currentColor} +@media (max-width:640px){.row{grid-template-columns:1fr auto}.row p{grid-column:1/-1;grid-row:2}} @@ -113,7 +135,7 @@ def html_rows(run_by_command):

{hint}

{sections} - +