docs: [verified] answer the six-month AI Architect assignment
Build and publish Eldorado documentation / build (pull_request) Successful in 1m30s
Build and publish Eldorado documentation / build (pull_request) Successful in 1m30s
This commit is contained in:
1 parent
88a4375776
commit
1a2d16bc91
53 files changed
+974
-390
No files matched your search
@@ -0,0 +1,16 @@
|
||||
// Caption the retained optional target without changing its native topology.
|
||||
// Text lives inside the SVG so standalone exports retain proposal/line semantics.
|
||||
export function targetCaption(html) {
|
||||
const roots = [...html.matchAll(/<svg\b[^>]*role="img"[^>]*>/g)];
|
||||
if (roots.length !== 1) throw new Error('Target caption SVG contract drift');
|
||||
const root = roots[0][0];
|
||||
const match = /viewBox="([\d. -]+)"/.exec(root);
|
||||
if (!match) throw new Error('Target caption requires viewBox');
|
||||
const [x,y,w,h] = match[1].trim().split(/\s+/).map(Number);
|
||||
const size = Math.min(26, w / 30);
|
||||
const lines = ['Proposed optional target — not a six-month commitment',
|
||||
'Solid: lifecycle · Dotted: execution / governance', 'Dashed: human-controlled contributions'];
|
||||
const extra = size * 5;
|
||||
const caption = `<g id="eldorado-target-caption" aria-label="Proposed target legend">${lines.map((line,i) => `<text x="${x+20}" y="${y+h+size*(1.2+i*1.3)}" font-family="Arial, sans-serif" font-size="${size}" style="font-size:${size}px!important" class="t-primary">${line}</text>`).join('')}</g>`;
|
||||
return html.replace(root, root.replace(match[0], `viewBox="${x} ${y} ${w} ${h+extra}"`) + caption);
|
||||
}
|
||||
Reference in new issue
Block a user