aienos.com
Source of www.aienos.com, served from my own hardware
Brought by drakestapleton
aienos.com / om / site / markdown.om
| 1 | note Source-preserving handwritten HTML import and HTML-to-Markdown mirrors. |
| 2 | note The source arena is separate from JSON and registry metadata. |
| 3 | note The /now/ page passed 900000 bytes on 2026-11-06 (ledger growth). A while loop runs at most |
| 4 | note 999999 iterations, so every scan over shbuf runs in blocks of 999000 positions, five blocks. |
| 5 | global shbuf uchar 4194304 |
| 6 | global shlen ulong 1 |
| 7 | global shhref uchar 4096 |
| 8 | global shhn ulong 1 |
| 9 | global shrrow ulong 1 |
| 10 | text shmain "<main" |
| 11 | text shmc "</main>" |
| 12 | text shbody "<body" |
| 13 | text shbc "</body>" |
| 14 | text shhead "</head>" |
| 15 | text shscript "<script" |
| 16 | text shscrc "</script>" |
| 17 | text shstyle "<style" |
| 18 | text shstyc "</style>" |
| 19 | text shheader "<header" |
| 20 | text shhedc "</header>" |
| 21 | text shnav "<nav" |
| 22 | text shnavc "</nav>" |
| 23 | text shfoot "<footer" |
| 24 | text shftc "</footer>" |
| 25 | text shsvg "<svg" |
| 26 | text shsvgc "</svg>" |
| 27 | text shtemp "<template" |
| 28 | text shtempc "</template>" |
| 29 | text shcomm "<!--" |
| 30 | text shcomc "-->" |
| 31 | text shnl "\n" |
| 32 | text shhost "https://www.aienos.com" |
| 33 | text shdiv "<div" |
| 34 | text shdivc "</div>" |
| 35 | text shgt ">" |
| 36 | text shag "id=\"ag-data\"" |
| 37 | text shagr "id='ag-data'" |
| 38 | text shld "application/ld+json" |
| 39 | text shref "href=" |
| 40 | text shstyles "<link" |
| 41 | text shrel "stylesheet" |
| 42 | text shbcss "/assets/style.css" |
| 43 | text shnavcss "/assets/site-nav.css" |
| 44 | text shnewcss "/assets/site.css" |
| 45 | text shnewjs "/js/site.js" |
| 46 | text shintro "/js/allen-intro.js" |
| 47 | text shicss "/assets/allen-intro.css" |
| 48 | text shdtc "</dt>" |
| 49 | text shdtsep ": " |
| 50 | text shta "<textarea" |
| 51 | text shprec "</pre" |
| 52 | text shtac "</textarea" |
| 53 | text shfopen "\n```\n" |
| 54 | text shfclose "```\n" |
| 55 | |
| 56 | text SH0001 "&" |
| 57 | text shchrome "aien-header" |
| 58 | text shfchr "aien-footer" |
| 59 | text shnchr "aien-nav" |
| 60 | text shaid "id=\"allen\"" |
| 61 | text shaid2 "id='allen'" |
| 62 | text shdoor " data-home-door=\"true\"" |
| 63 | text SH0002 "<" |
| 64 | text SH0003 ">" |
| 65 | text SH0004 """ |
| 66 | text SH0005 "'" |
| 67 | text SH0006 "'" |
| 68 | text SH0007 " " |
| 69 | text SH0008 "&" |
| 70 | text SH0009 "<" |
| 71 | text SH0010 ">" |
| 72 | text SH0011 "\"" |
| 73 | text SH0012 "'" |
| 74 | text shhash "#" |
| 75 | text shhashc "#" |
| 76 | text SH0013 " " |
| 77 | text SH0014 "[" |
| 78 | text SH0015 "](" |
| 79 | text SH0016 ")" |
| 80 | text SH0017 "<h1" |
| 81 | text SH0018 "<h2" |
| 82 | text SH0019 "<h3" |
| 83 | text SH0020 "<h4" |
| 84 | text SH0021 "<a " |
| 85 | text SH0022 "</a>" |
| 86 | text SH0023 "<li" |
| 87 | text SH0024 "<br" |
| 88 | text SH0025 "<p" |
| 89 | text SH0026 "<div" |
| 90 | text SH0027 "<section" |
| 91 | text SH0028 "<tr" |
| 92 | text SH0029 "<td" |
| 93 | text SH0030 "<th" |
| 94 | text SH0031 "<pre" |
| 95 | text SH0032 "</p" |
| 96 | text SH0033 "</li" |
| 97 | text SH0034 "</h" |
| 98 | text SH0035 "\n\n# " |
| 99 | text SH0036 "\n\n## " |
| 100 | text SH0037 "\n\n### " |
| 101 | text SH0038 "\n- " |
| 102 | text SH0039 " " |
| 103 | |
| 104 | fn sh_load path view uchar * to void |
| 105 | fd = fopen path 0 len path 0 0 |
| 106 | if lt fd 0 |
| 107 | trap 10 |
| 108 | end |
| 109 | n = ulong 0 |
| 110 | while true bound 999999 |
| 111 | r = read int fd shbuf n sub len shbuf n |
| 112 | if lt r 0 |
| 113 | trap 10 |
| 114 | end |
| 115 | if eq r 0 |
| 116 | break |
| 117 | end |
| 118 | n = add n ulong r |
| 119 | if gt n 4000000 |
| 120 | trap 3 |
| 121 | end |
| 122 | end |
| 123 | r = fclose int fd |
| 124 | if ne r 0 |
| 125 | trap 10 |
| 126 | end |
| 127 | put shlen 0 n |
| 128 | end |
| 129 | |
| 130 | fn sh_at pattern view uchar * pos ulong to bool |
| 131 | if gt pos get shlen 0 |
| 132 | ret false |
| 133 | end |
| 134 | if gt len pattern sub get shlen 0 pos |
| 135 | ret false |
| 136 | end |
| 137 | for i ulong len pattern |
| 138 | if ne get shbuf add pos i get pattern i |
| 139 | ret false |
| 140 | end |
| 141 | end |
| 142 | ret true |
| 143 | end |
| 144 | |
| 145 | fn sh_find pattern view uchar * pos ulong to ulong |
| 146 | p = pos |
| 147 | for blk ulong 5 |
| 148 | lim = add p 999000 |
| 149 | while and lt p get shlen 0 lt p lim bound 999999 |
| 150 | if sh_at pattern p |
| 151 | ret p |
| 152 | end |
| 153 | p = add p 1 |
| 154 | end |
| 155 | end |
| 156 | ret get shlen 0 |
| 157 | end |
| 158 | |
| 159 | fn sh_end pos ulong to ulong |
| 160 | p = pos |
| 161 | quote = uchar 0 |
| 162 | for blk ulong 5 |
| 163 | lim = add p 999000 |
| 164 | while and lt p get shlen 0 lt p lim bound 999999 |
| 165 | c = get shbuf p |
| 166 | if ne quote 0 |
| 167 | if eq c quote |
| 168 | quote = 0 |
| 169 | end |
| 170 | else |
| 171 | if or eq c 34 eq c 39 |
| 172 | quote = c |
| 173 | else |
| 174 | if eq c 62 |
| 175 | ret add p 1 |
| 176 | end |
| 177 | end |
| 178 | end |
| 179 | p = add p 1 |
| 180 | end |
| 181 | end |
| 182 | trap 10 |
| 183 | end |
| 184 | |
| 185 | fn sh_range start ulong finish ulong to void |
| 186 | buf = new uchar 8192 0 |
| 187 | p = start |
| 188 | while lt p finish bound 999999 |
| 189 | n = sub finish p |
| 190 | if gt n len buf |
| 191 | n = len buf |
| 192 | end |
| 193 | for i ulong n |
| 194 | put buf i get shbuf add p i |
| 195 | end |
| 196 | sr_raw part buf 0 n |
| 197 | p = add p n |
| 198 | end |
| 199 | end |
| 200 | |
| 201 | fn sh_contains pattern view uchar * start ulong finish ulong to bool |
| 202 | p = sh_find pattern start |
| 203 | ret lt p finish |
| 204 | end |
| 205 | |
| 206 | fn sh_after closepat view uchar * start ulong to ulong |
| 207 | p = sh_find closepat start |
| 208 | if eq p get shlen 0 |
| 209 | trap 10 |
| 210 | end |
| 211 | ret add p len closepat |
| 212 | end |
| 213 | |
| 214 | fn sh_skip pos ulong to ulong |
| 215 | if sh_at shcomm pos |
| 216 | ret sh_after shcomc pos |
| 217 | end |
| 218 | if sh_at shscript pos |
| 219 | ret sh_after shscrc pos |
| 220 | end |
| 221 | if sh_at shstyle pos |
| 222 | ret sh_after shstyc pos |
| 223 | end |
| 224 | if sh_at shsvg pos |
| 225 | ret sh_after shsvgc pos |
| 226 | end |
| 227 | q = sh_shared pos |
| 228 | if ne q pos |
| 229 | ret q |
| 230 | end |
| 231 | if sh_at shtemp pos |
| 232 | ret sh_after shtempc pos |
| 233 | end |
| 234 | ret pos |
| 235 | end |
| 236 | |
| 237 | fn sh_extra start ulong finish ulong to void |
| 238 | p = start |
| 239 | for blk ulong 5 |
| 240 | lim = add p 999000 |
| 241 | while and lt p finish lt p lim bound 999999 |
| 242 | if sh_at shstyle p |
| 243 | q = sh_after shstyc p |
| 244 | sh_range p q |
| 245 | p = q |
| 246 | else |
| 247 | if sh_at shscript p |
| 248 | q = sh_after shscrc p |
| 249 | if not or sh_contains shld p q sh_contains shintro p q |
| 250 | sh_range p q |
| 251 | end |
| 252 | p = q |
| 253 | else |
| 254 | if sh_at shstyles p |
| 255 | q = sh_end p |
| 256 | if sh_contains shrel p q |
| 257 | if not or or sh_contains shbcss p q sh_contains shnavcss p q sh_contains shicss p q |
| 258 | sh_range p q |
| 259 | end |
| 260 | end |
| 261 | p = q |
| 262 | else |
| 263 | p = add p 1 |
| 264 | end |
| 265 | end |
| 266 | end |
| 267 | end |
| 268 | end |
| 269 | end |
| 270 | |
| 271 | fn sh_relink pos ulong to ulong |
| 272 | if gh_probe pos |
| 273 | ret gh_emit pos |
| 274 | end |
| 275 | if sl_probe pos |
| 276 | ret sl_emit pos |
| 277 | end |
| 278 | ret pos |
| 279 | end |
| 280 | |
| 281 | fn sh_preserve start ulong finish ulong to void |
| 282 | p = start |
| 283 | mark = start |
| 284 | for blk ulong 5 |
| 285 | lim = add p 999000 |
| 286 | while and lt p finish lt p lim bound 999999 |
| 287 | if sh_at shscript p |
| 288 | q = sh_end p |
| 289 | if or sh_contains shag p q sh_contains shagr p q |
| 290 | sh_range mark p |
| 291 | p = sh_after shscrc p |
| 292 | mark = p |
| 293 | else |
| 294 | p = sh_after shscrc p |
| 295 | end |
| 296 | else |
| 297 | q = sh_relink_probe p |
| 298 | if ne q p |
| 299 | sh_range mark p |
| 300 | q = sh_relink p |
| 301 | p = q |
| 302 | mark = p |
| 303 | else |
| 304 | p = add p 1 |
| 305 | end |
| 306 | end |
| 307 | end |
| 308 | end |
| 309 | sh_range mark finish |
| 310 | end |
| 311 | |
| 312 | fn sh_relink_probe pos ulong to ulong |
| 313 | if gh_probe pos |
| 314 | ret add pos 1 |
| 315 | end |
| 316 | if sl_probe pos |
| 317 | ret add pos 1 |
| 318 | end |
| 319 | ret pos |
| 320 | end |
| 321 | |
| 322 | fn sh_body source view uchar * to void |
| 323 | sh_load source |
| 324 | p = sh_find shmain 0 |
| 325 | if lt p get shlen 0 |
| 326 | q = sh_end p |
| 327 | sr_raw shdiv |
| 328 | sh_range add p len shmain q |
| 329 | finish = sh_find shmc q |
| 330 | if eq finish get shlen 0 |
| 331 | trap 10 |
| 332 | end |
| 333 | sh_preserve q finish |
| 334 | sr_raw shdivc |
| 335 | sh_extra add finish len shmc get shlen 0 |
| 336 | else |
| 337 | p = sh_find shbody 0 |
| 338 | p = sh_end p |
| 339 | finish = sh_find shbc p |
| 340 | for blk ulong 5 |
| 341 | lim = add p 999000 |
| 342 | while and lt p finish lt p lim bound 999999 |
| 343 | z = sh_shared p |
| 344 | if ne z p |
| 345 | p = z |
| 346 | else |
| 347 | q = sh_unshared add p 1 finish |
| 348 | sh_preserve p q |
| 349 | p = q |
| 350 | end |
| 351 | end |
| 352 | end |
| 353 | end |
| 354 | end |
| 355 | |
| 356 | fn sh_unshared pos ulong finish ulong to ulong |
| 357 | q = pos |
| 358 | for blk ulong 5 |
| 359 | lim = add q 999000 |
| 360 | while and lt q finish lt q lim bound 999999 |
| 361 | if ne sh_shared q q |
| 362 | ret q |
| 363 | end |
| 364 | q = add q 1 |
| 365 | end |
| 366 | end |
| 367 | ret q |
| 368 | end |
| 369 | |
| 370 | fn sh_char pos ulong to void |
| 371 | buf = new uchar 1 0 |
| 372 | put buf 0 get shbuf pos |
| 373 | sr_raw buf |
| 374 | end |
| 375 | |
| 376 | fn sh_entity pos ulong to ulong |
| 377 | if sh_at SH0001 pos |
| 378 | sr_raw SH0008 |
| 379 | ret add pos len SH0001 |
| 380 | end |
| 381 | if sh_at SH0002 pos |
| 382 | sr_raw SH0009 |
| 383 | ret add pos len SH0002 |
| 384 | end |
| 385 | if sh_at SH0003 pos |
| 386 | sr_raw SH0010 |
| 387 | ret add pos len SH0003 |
| 388 | end |
| 389 | if sh_at SH0004 pos |
| 390 | sr_raw SH0011 |
| 391 | ret add pos len SH0004 |
| 392 | end |
| 393 | if sh_at SH0005 pos |
| 394 | sr_raw SH0012 |
| 395 | ret add pos len SH0005 |
| 396 | end |
| 397 | if sh_at SH0006 pos |
| 398 | sr_raw SH0012 |
| 399 | ret add pos len SH0006 |
| 400 | end |
| 401 | if sh_at SH0007 pos |
| 402 | sr_raw SH0013 |
| 403 | ret add pos len SH0007 |
| 404 | end |
| 405 | if sh_at shhash pos |
| 406 | sr_raw shhashc |
| 407 | ret add pos len shhash |
| 408 | end |
| 409 | sh_char pos |
| 410 | ret add pos 1 |
| 411 | end |
| 412 | |
| 413 | fn sh_link pos ulong finish ulong to void |
| 414 | p = sh_find shref pos |
| 415 | if ge p finish |
| 416 | put shhn 0 0 |
| 417 | ret |
| 418 | end |
| 419 | p = add p len shref |
| 420 | quote = get shbuf p |
| 421 | p = add p 1 |
| 422 | n = ulong 0 |
| 423 | while lt p finish bound 4096 |
| 424 | if eq get shbuf p quote |
| 425 | break |
| 426 | end |
| 427 | if ge n len shhref |
| 428 | trap 3 |
| 429 | end |
| 430 | put shhref n gh_entbyte p |
| 431 | n = add n 1 |
| 432 | p = add p gh_entlen p |
| 433 | end |
| 434 | put shhn 0 n |
| 435 | if gt n 0 |
| 436 | sr_raw SH0014 |
| 437 | end |
| 438 | end |
| 439 | |
| 440 | fn sh_link_end to void |
| 441 | buf = new uchar 4096 0 |
| 442 | n = get shhn 0 |
| 443 | if eq n 0 |
| 444 | ret |
| 445 | end |
| 446 | for i ulong n |
| 447 | put buf i get shhref i |
| 448 | end |
| 449 | sr_raw SH0015 |
| 450 | sl_markdown_url part buf 0 n |
| 451 | sr_raw SH0016 |
| 452 | put shhn 0 0 |
| 453 | end |
| 454 | |
| 455 | fn sh_mdtag pos ulong finish ulong to void |
| 456 | if sh_at SH0017 pos |
| 457 | sr_raw SH0035 |
| 458 | ret |
| 459 | end |
| 460 | if sh_at SH0018 pos |
| 461 | sr_raw SH0036 |
| 462 | ret |
| 463 | end |
| 464 | if or sh_at SH0019 pos sh_at SH0020 pos |
| 465 | sr_raw SH0037 |
| 466 | ret |
| 467 | end |
| 468 | if sh_at SH0021 pos |
| 469 | sh_link pos finish |
| 470 | ret |
| 471 | end |
| 472 | if sh_at SH0022 pos |
| 473 | sh_link_end |
| 474 | ret |
| 475 | end |
| 476 | if sh_at SH0023 pos |
| 477 | sr_raw SH0038 |
| 478 | ret |
| 479 | end |
| 480 | if or sh_at SH0029 pos sh_at SH0030 pos |
| 481 | sr_raw SH0039 |
| 482 | ret |
| 483 | end |
| 484 | if sh_at shdtc pos |
| 485 | sr_raw shdtsep |
| 486 | ret |
| 487 | end |
| 488 | if sh_opencode pos |
| 489 | sr_raw shfopen |
| 490 | ret |
| 491 | end |
| 492 | if or sh_at shprec pos sh_at shtac pos |
| 493 | if ne get shbuf sub pos 1 10 |
| 494 | sr_raw shnl |
| 495 | end |
| 496 | sr_raw shfclose |
| 497 | ret |
| 498 | end |
| 499 | xhit = sh_at SH0024 pos |
| 500 | xhit = or xhit sh_at SH0025 pos |
| 501 | xhit = or xhit sh_at SH0026 pos |
| 502 | xhit = or xhit sh_at SH0027 pos |
| 503 | xhit = or xhit sh_at SH0028 pos |
| 504 | xhit = or xhit sh_at SH0031 pos |
| 505 | xhit = or xhit sh_at SH0032 pos |
| 506 | xhit = or xhit sh_at SH0033 pos |
| 507 | xhit = or xhit sh_at SH0034 pos |
| 508 | if xhit |
| 509 | sr_raw shnl |
| 510 | end |
| 511 | end |
| 512 | |
| 513 | fn sh_opencode pos ulong to bool |
| 514 | ret or sh_at SH0031 pos sh_at shta pos |
| 515 | end |
| 516 | |
| 517 | fn sh_markdown source view uchar * row ulong to void |
| 518 | sh_load source |
| 519 | put shrrow 0 row |
| 520 | p = sh_find shmain 0 |
| 521 | if eq p get shlen 0 |
| 522 | p = sh_find shbody 0 |
| 523 | end |
| 524 | p = sh_end p |
| 525 | finish = sh_find shmc p |
| 526 | if eq finish get shlen 0 |
| 527 | finish = sh_find shbc p |
| 528 | end |
| 529 | put shhn 0 0 |
| 530 | for blk ulong 5 |
| 531 | lim = add p 999000 |
| 532 | while and lt p finish lt p lim bound 999999 |
| 533 | if eq get shbuf p 60 |
| 534 | q = sh_skip p |
| 535 | if ne q p |
| 536 | p = q |
| 537 | else |
| 538 | q = sh_end p |
| 539 | sh_mdtag p q |
| 540 | if sh_opencode p |
| 541 | if eq get shbuf q 10 |
| 542 | q = add q 1 |
| 543 | end |
| 544 | end |
| 545 | p = q |
| 546 | end |
| 547 | else |
| 548 | p = sh_entity p |
| 549 | end |
| 550 | end |
| 551 | end |
| 552 | sr_raw shnl |
| 553 | end |
| 554 | |
| 555 | fn sh_shared pos ulong to ulong |
| 556 | if sh_at shheader pos |
| 557 | q = sh_end pos |
| 558 | if sh_contains shchrome pos q |
| 559 | ret sh_after shhedc pos |
| 560 | end |
| 561 | end |
| 562 | if sh_at shfoot pos |
| 563 | q = sh_end pos |
| 564 | if sh_contains shfchr pos q |
| 565 | ret sh_after shftc pos |
| 566 | end |
| 567 | end |
| 568 | if sh_at shnav pos |
| 569 | q = sh_end pos |
| 570 | if sh_contains shnchr pos q |
| 571 | ret sh_after shnavc pos |
| 572 | end |
| 573 | end |
| 574 | ret pos |
| 575 | end |
| 576 | |
| 577 | fn sh_allen_home source view uchar * to void |
| 578 | sh_load source |
| 579 | p = sh_find shaid 0 |
| 580 | if eq p get shlen 0 |
| 581 | p = sh_find shaid2 0 |
| 582 | end |
| 583 | if eq p get shlen 0 |
| 584 | trap 10 |
| 585 | end |
| 586 | p = add p len shaid |
| 587 | sh_range 0 p |
| 588 | sr_raw shdoor |
| 589 | sh_range p get shlen 0 |
| 590 | end |