#sleela 2.1 // emitter.sleela -- assembles an ordered list of signs under a Design into a // complete, self-contained HTML document (markup + an embedded style sheet). // No external CSS/JS is required to view the result. This is the authoritative // renderer: the GUI calls it, it never duplicates it. // // The style sheet is derived entirely from the Design: CSS custom properties // carry the palette, a modular scale carries typography and spacing, and the // energy dial selects flat color, soft gradients, or a bold animated gradient. class Emitter { // Produce the "; return css; } // Render a single sign to HTML, using the Signs helper for naming. string renderSign(Signs.Sign s, Signs signs) { if (s.kind == 0) { return ""; } if (s.kind == 1) { return "

" + s.a + "

" + s.b + "

" + s.c + "
"; } if (s.kind == 2) { return "

" + s.a + "

" + s.b + "
"; } if (s.kind == 3) { return "

" + s.a + "

" + s.b + "
"; } if (s.kind == 4) { return "

" + s.a + "

" + s.b + "
"; } if (s.kind == 5) { return "
\u201c" + s.a + "\u201d
\u2014 " + s.b + "
"; } if (s.kind == 6) { return "

" + s.a + "

" + s.b + "
"; } if (s.kind == 7) { return "
" + s.a + "
"; } return ""; } // Wrap a design's style + a pre-rendered body into a full HTML document. string document(string title, string style, string body) { string html = ""; html = html + "\n\n\n"; html = html + "\n"; html = html + "\n"; html = html + "" + title + "\n"; html = html + style + "\n\n\n"; html = html + body; html = html + "\n\n\n"; return html; } string intToStr(int v) { return "" + v; } }