tickets
All repositories: gitoria
2.4 KB
// lib/import.hl — the AntColony ticket file format (the import's parser), shared by tools/import.hl and the one-off// tools/fix-import-summaries.hl. Statics only (no top-level work: importing it runs nothing).//// A ticket file is `project:` and `subject:` header lines, a blank line, the summary.// The summary is HARD-WRAPPED text: lines are joined into paragraphs (one space between// them), a blank line starts a new paragraph, a list line starts a new line; paragraphs are separated by one empty line// ("\n\n") in the stored summary, which the ticket page renders with `white-space: pre-wrap`.// CRLF files work: every line is trim()med, which drops the carriage return. (Hybriel// strings have no escapes — "\r" would be two characters, so there is no CR constant.)static NL = ""// A MARKDOWN LIST LINE (`- `, `* `, `1. ` after trimming) stays its own line (ticket #15):// it starts a new line inside the paragraph ("\n"); a following ordinary line is still// joined onto it (a wrapped list item). Nested indentation is not kept.static isListLine = (line) => {if (line.startsWith('- ') || line.startsWith('* ')) { return true }let i = 0while (i < line.length && line.charCodeAt(i) >= 48 && line.charCodeAt(i) <= 57) { i = i + 1 }return i > 0 && line.slice(i, i + 2) == '. '}// hard-wrapped text → paragraphs joined by "\n\n" (list lines inside one by "\n")static paragraphsOf = (text) => {let paras = []let cur = []for (raw of text.split(NL)) {let line = raw.trim()if (line == '') {if (cur.length > 0) { paras.push(cur.join(NL)) }cur = []} else if (cur.length == 0 || isListLine(line)) {cur.push(line)} else {cur[cur.length - 1] = cur[cur.length - 1] + ' ' + line}}if (cur.length > 0) { paras.push(cur.join(NL)) }return paras.join(NL + NL)}// { project, subject, summary } or { error }static parse = (text) => {let lines = text.split(NL)let head = {}let i = 0while (i < lines.length && lines[i].trim() != '') {let line = lines[i]let c = line.indexOf(':')if (c > 0) { head[line.slice(0, c).trim().toLowerCase()] = line.slice(c + 1).trim() }i = i + 1}let body = []i = i + 1while (i < lines.length) {body.push(lines[i])i = i + 1}if (head.project == null || head.project == '') { return { error = 'no project: line' } }if (head.subject == null || head.subject == '') { return { error = 'no subject: line' } }return { project = head.project subject = head.subject summary = paragraphsOf(body.join(NL)) }}
Branches
- mainmain branch
Latest commits
- e9d5c618mission 010 (code order) 2/4: one lib/ file per topic — store.hl split into projects / tickets (+ relations) / events / tickets-helpers, util.hl shared helpers (env, storage dir, URLs, sorts, Vienna time), the function routes out of project.hl into lib/api.hl (thin; auth/filters/Accept in api-helpers.hl), invite + member-removal logic out of the faces/routes into invites.hl / tickets.hl; project.hl is the map. /login/callback gets req + the session store by reference. gate 249/0, connect 60/0, real-data reads identicalmre
- 97e269b5mission 010 (code order) 1/4: .hl files out of the root — lib/ (store, users, connections, invites, migrate, markdown, mdview, import = ticketfile, util = localtime, jsoncheck, api-helpers = api), tools/import.hl, components/styles.hl; import paths only. gate 249/0, connect 60/0, real-data reads identicalmre
- 38f9d10ftickets: Hybriel master 06617221 (plugin allocators 3a781359 + 413f60e4, mpackdb 2cb7ae5e, http1 773de63e); gate 249/0, connect 60/0mre
- d3db6139tickets: Hybriel master 190aa11d (fc838894 GC correctness, #126 closure scopes, #127); gate 249/0, connect 60/0mre
- bce182e3tickets: Hybriel master 7eea0d32 (#126 memory, #48 lambda copies its argument); migrate.hl lambdas take &logmre
- 4137be0fantcolony#40: mission references point to the moved missionsmre
- 9bfba36aantcolony#40: history (LOG.md), worker briefs (missions/) and reports moved here from antcolony, numbered per project; old numbers in antcolony docs/mission-map.mdmre
- c7bd2645tickets: Hybriel master 73267707 (#122 fixed); compactNow workaround removed (#110 covered)mre
- 2ab91ee9tickets: gate checks rows appear once (session sync); re-vendor to ff51cf46 stopped on hybriel#122, stays 837fe120mre
- e01c2b1dtickets#24: installable app (manifest, service worker, offline list), own icon; gate waits for the hello's pongmre
- 752fbb7fdeploy.sh: back up live storage/.sessions/.env before every deploy (newest 5 kept)mre
- 38bdd5e4deploy.sh: never send .git or .gitignore to Byrodinmre
- f12fa1bcState of 2026-09-27, before the move to gitoriamre