From f0b79f27b7f17e3862285e01b71aad30cb25cd89 Mon Sep 17 00:00:00 2001 From: Ahmed Date: Sat, 20 Jun 2026 00:07:58 +0300 Subject: fix: bunch of vibed edits to fix vibed edits --- web/README.md | 12 ++++++------ web/scripts/gen_tool.py | 46 +++++++++++++++++++++++----------------------- 2 files changed, 29 insertions(+), 29 deletions(-) (limited to 'web') diff --git a/web/README.md b/web/README.md index 3acccf5..31c1c28 100644 --- a/web/README.md +++ b/web/README.md @@ -4,11 +4,11 @@ Web-based UGI (Unified Geek Identifier) tool: encoder, decoder, format converter ## Pages -- **/** — about the project and format examples -- **/specs/** — full field-by-field spec reference -- **/encoder/** — form-based interface to build a UGI string -- **/decoder/** — paste a UGI string (URI or block format) and get a human-readable breakdown -- **/converter/** — convert between URI format and block format +- **/** : about the project and format examples +- **/specs/** : full field-by-field spec reference +- **/encoder/** : form-based interface to build a UGI string +- **/decoder/** : paste a UGI string (URI or block format) and get a human-readable breakdown +- **/converter/** : convert between URI format and block format Each page shares the same network-standard CSS and sub-navigation. @@ -34,7 +34,7 @@ web/ └── README.md ``` -Generated HTML files are not committed — they are produced by the post-receive hook on the server. +Generated HTML files are not committed. They are produced by the post-receive hook on the server. ## License diff --git a/web/scripts/gen_tool.py b/web/scripts/gen_tool.py index bbafcfb..a3d3012 100644 --- a/web/scripts/gen_tool.py +++ b/web/scripts/gen_tool.py @@ -131,17 +131,17 @@ def build_home(reg):
ugi:0@neo:gcy$/sec/os,a3,b5/3,c1,hh2,e6,len6zh4,oxd7$fb6,pc6$ba7as5rs5,ded7,w6,q7$,i1,v6/5,rat5,tff7bs6bl6,k7,jro6pc7,mmt6el5,s2,y5,f3,z6
""" fields_summary = "\n".join( - f"
  • {code} — {f['name']}
  • " + f"
  • {code}: {f['name']}
  • " for code, f in sorted(reg["fields"].items()) ) content = f"""

    {desc}

    design goals

    @@ -180,7 +180,7 @@ def build_specs(reg): for code in codes: f = reg["fields"][code] req = " (required)" if code == "g" else "" - out += f"

    {htmlmod.escape(code)} — {htmlmod.escape(f['name'])}{req}

    " + out += f"

    {htmlmod.escape(code)}: {htmlmod.escape(f['name'])}{req}

    " if f.get("description"): out += f'

    {htmlmod.escape(f["description"])}

    ' @@ -198,22 +198,22 @@ def build_specs(reg): out += '
      ' for i in range(8): v = f["values"].get(str(i), {}) - label = htmlmod.escape(v.get("label", "—")) + label = htmlmod.escape(v.get("label", "")) humor = v.get("humor", "") out += f"
    1. {label}" if humor: - out += f" — {htmlmod.escape(humor)}" + out += f": {htmlmod.escape(humor)}" out += "
    2. " out += "
    " if f.get("scale_labels"): out += '
      ' for i in range(8): - label = htmlmod.escape(f["scale_labels"].get(str(i), "—")) + label = htmlmod.escape(f["scale_labels"].get(str(i), "")) humor = f.get("humor_scale", {}).get(str(i), "") out += f"
    1. {label}" if humor: - out += f" — {htmlmod.escape(humor)}" + out += f": {htmlmod.escape(humor)}" out += "
    2. " out += "
    " elif f.get("humor_scale"): @@ -227,7 +227,7 @@ def build_specs(reg): for sid, sv in f["sub_ids"].items(): name = sv.get("name", sid) if isinstance(sv, dict) else sv long = sv.get("long", "") if isinstance(sv, dict) else "" - out += f"
  • {sid} — {htmlmod.escape(str(name))}" + out += f"
  • {sid}: {htmlmod.escape(str(name))}" if long: out += f" (block alias: {long})" out += "
  • " @@ -239,7 +239,7 @@ def build_specs(reg): out += f"

    {htmlmod.escape(label)}

    " if f.get("dimensions"): @@ -441,7 +441,7 @@ function buildEncoder() { const summary = document.createElement('summary'); const skipId = 'skip-' + code; const reqLabel = isRequired ? ' (required)' : ''; - summary.innerHTML = code.toUpperCase() + ' — ' + f.name + reqLabel + + summary.innerHTML = code.toUpperCase() + ': ' + f.name + reqLabel + ''; section.appendChild(summary); @@ -514,7 +514,7 @@ function buildDirectField(container, code, f) { aSel.id = 'enc-' + code + '-aspire'; for (let i = 5; i <= 7; i++) { const opt = document.createElement('option'); - opt.value = i; opt.textContent = i + ' — ' + (scale[i] ? (scale[i].label || '') : ''); + opt.value = i; opt.textContent = i + ': ' + (scale[i] ? (scale[i].label || '') : ''); aSel.appendChild(opt); } aSel.onchange = function() { encodeUGI(); }; @@ -532,7 +532,7 @@ function buildMultiField(container, code, f) { const sel = document.createElement('select'); sel.id = 'enc-' + code + '-sel'; const defOpt = document.createElement('option'); - defOpt.value = ''; defOpt.textContent = '— select —'; + defOpt.value = ''; defOpt.textContent = 'select'; sel.appendChild(defOpt); let lastGroup = ''; for (const s of subIds) { @@ -541,7 +541,7 @@ function buildMultiField(container, code, f) { optg.label = s.group; sel.appendChild(optg); lastGroup = s.group; } const opt = document.createElement('option'); - opt.value = s.code; opt.textContent = s.code + ' — ' + s.name; + opt.value = s.code; opt.textContent = s.code + ': ' + s.name; if (lastGroup) sel.lastElementChild.appendChild(opt); else sel.appendChild(opt); } @@ -574,7 +574,7 @@ function buildMultiField(container, code, f) { aSel.id = 'enc-' + code + '-add-aspire'; for (let i = 5; i <= 7; i++) { const opt = document.createElement('option'); - opt.value = i; opt.textContent = i + ' — ' + (scale[i] ? (scale[i].label || '') : ''); + opt.value = i; opt.textContent = i + ': ' + (scale[i] ? (scale[i].label || '') : ''); aSel.appendChild(opt); } addRow.appendChild(aSel); @@ -616,10 +616,10 @@ function buildSingleField(container, code, f) { const subIds = getSubIds(code); const scale = getScale(code); const sel = document.createElement('select'); sel.id = 'enc-' + code + '-sub'; sel.onchange = function() { markIncluded(code); encodeUGI(); }; - const defOpt = document.createElement('option'); defOpt.value = ''; defOpt.textContent = '— select —'; + const defOpt = document.createElement('option'); defOpt.value = ''; defOpt.textContent = 'select'; sel.appendChild(defOpt); for (const s of subIds) { - const opt = document.createElement('option'); opt.value = s.code; opt.textContent = s.code + ' — ' + s.name; + const opt = document.createElement('option'); opt.value = s.code; opt.textContent = s.code + ': ' + s.name; sel.appendChild(opt); } container.appendChild(sel); @@ -710,10 +710,10 @@ function buildLangField(container, f) { const addRow = document.createElement('div'); addRow.className = 'multi-add'; const codes = f.common_codes || {}; const sel = document.createElement('select'); sel.id = 'enc-l-sel'; - const defOpt = document.createElement('option'); defOpt.value = ''; defOpt.textContent = '— select or type —'; + const defOpt = document.createElement('option'); defOpt.value = ''; defOpt.textContent = 'select or type'; sel.appendChild(defOpt); for (const [k,v] of Object.entries(codes)) { - const opt = document.createElement('option'); opt.value = k; opt.textContent = k + ' — ' + v; sel.appendChild(opt); + const opt = document.createElement('option'); opt.value = k; opt.textContent = k + ': ' + v; sel.appendChild(opt); } addRow.appendChild(sel); const customInput = document.createElement('input'); @@ -732,7 +732,7 @@ function buildLangField(container, f) { if (mods.aspire) { const aCb = document.createElement('label'); aCb.innerHTML = ' +'; addRow.appendChild(aCb); const aSel = document.createElement('select'); aSel.id = 'enc-l-add-aspire'; - for (let i = 5; i <= 7; i++) { const opt = document.createElement('option'); opt.value = i; opt.textContent = i + ' — ' + (scale[i] ? (scale[i].label || '') : ''); aSel.appendChild(opt); } + for (let i = 5; i <= 7; i++) { const opt = document.createElement('option'); opt.value = i; opt.textContent = i + ': ' + (scale[i] ? (scale[i].label || '') : ''); aSel.appendChild(opt); } addRow.appendChild(aSel); } const addBtn = document.createElement('button'); addBtn.textContent = 'add'; @@ -956,7 +956,7 @@ function convertUGI() { try { if (input.includes('BEGIN UGI BLOCK')) output.textContent = blockToUri(input); else if (input.toLowerCase().startsWith('ugi:')) output.textContent = uriToBlock(input); - else output.textContent = '(could not detect format — paste a URI starting with "ugi:" or a block)'; + else output.textContent = '(could not detect format: paste a URI starting with "ugi:" or a block)'; } catch(e) { output.textContent = 'error: ' + e.message; } } -- cgit v1.2.3