interplane.Get Omega
Read in your language

aienos.com

Source of www.aienos.com, served from my own hardware

Brought by drakestapleton

branch main Branches Tags History

aienos.com / om / site / markdown.om

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