Transpiled version (3809L) is out of date.
1 | sclass HTMLTokenization { |
2 | S internalID = aRandomID(); |
3 | S className = "cnc-" + internalID; |
4 | |
5 | new LS tokensHTML; // need to fill these at least |
6 | new LS spacingsHTML; |
7 | |
8 | // add params for the div here like style or class |
9 | new MapSO divParams; |
10 | |
11 | S headStuff() { ret ""; } |
12 | |
13 | int nCodeTokens() { ret l(tokensHTML); } |
14 | |
15 | S htmlAndJS() { ret html(); } |
16 | S html() { |
17 | ret hcss(replaceIdentifiers([[ |
18 | .className { |
19 | margin: 15px; |
20 | /*flex: 1;*/ |
21 | display: inline-grid; |
22 | grid-template-columns: repeat(]] + (nCodeTokens()*2+2) + [[, 1fr); |
23 | /*border: 1px solid;*/ |
24 | } |
25 | |
26 | .className div { |
27 | text-align: center; |
28 | box-sizing: border-box; |
29 | grid-column: auto / span 2; |
30 | } |
31 | |
32 | .className .cnc-token { |
33 | border: 1px solid; |
34 | margin: 5px; |
35 | } |
36 | |
37 | .className .cnc-spacing { |
38 | margin: 5px 10px; |
39 | border: 1px dotted gray; |
40 | color: gray; |
41 | } |
42 | |
43 | .className div:nth-child(1), |
44 | .className div:nth-child(]] + (nCodeTokens()+2) + [[) { |
45 | grid-column: auto / span 1 |
46 | } |
47 | ]], +className)) + div( |
48 | lines(concatLists( |
49 | ll(div()), |
50 | safeMap(tokensHTML, h -> div(h, class := "cnc-token")), |
51 | ll(div()), |
52 | safeMap(padList(spacingsHTML, nCodeTokens()+1, ""), |
53 | h -> div(h, class := "cnc-spacing")) |
54 | )), |
55 | paramsPlus(divParams, class := className)); |
56 | } |
57 | } |
Began life as a copy of #1030661
download show line numbers debug dex old transpilations
Travelled to 5 computer(s): bhatertpkbcr, ekrmjmnbrukm, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt
No comments. add comment
Snippet ID: | #1030682 |
Snippet name: | HTMLTokenization - render tokens + spacers in "brickwall" arrangement |
Eternal ID of this version: | #1030682/10 |
Text MD5: | 69280138051b17bf903d8a5136285db5 |
Author: | stefan |
Category: | javax / html |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-03-04 14:08:16 |
Source code size: | 1468 bytes / 57 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 223 / 457 |
Version history: | 9 change(s) |
Referenced in: | [show references] |