2016-01-26 03:52:58 +03:00
|
|
|
::
|
2016-02-11 03:41:28 +03:00
|
|
|
:::: /hoon/frontmatter/lib
|
2016-01-26 03:52:58 +03:00
|
|
|
::
|
2016-02-18 02:36:43 +03:00
|
|
|
/? 310
|
2016-11-17 04:42:58 +03:00
|
|
|
::
|
2016-12-03 01:14:39 +03:00
|
|
|
=, format
|
2016-01-26 03:52:58 +03:00
|
|
|
|%
|
|
|
|
++ atr-lines
|
2020-11-25 23:22:55 +03:00
|
|
|
|= atr=(map cord cord)
|
2020-11-26 17:09:31 +03:00
|
|
|
%+ turn (sort ~(tap by atr) |=([[a=@ @] [b=@ @]] (aor a b)))
|
|
|
|
|= [k=cord v=cord]
|
2016-01-26 03:52:58 +03:00
|
|
|
(rap 3 k ': ' v ~)
|
|
|
|
::
|
|
|
|
++ atr-key ;~(sfix (star ;~(less col prn)) col ace)
|
|
|
|
++ print
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [atr=(map cord cord) src=wain]
|
2016-01-26 03:52:58 +03:00
|
|
|
?~ atr src
|
|
|
|
['---' (welp (atr-lines atr) '---' src)]
|
|
|
|
++ parse
|
2020-11-25 23:22:55 +03:00
|
|
|
=| atr=(map cord cord)
|
|
|
|
|= wan=wain ^+ [atr mud='']
|
2016-01-26 03:52:58 +03:00
|
|
|
?~ wan [~ '']
|
|
|
|
?^ (rush i.wan (star ace))
|
|
|
|
$(wan t.wan)
|
2016-12-03 01:14:39 +03:00
|
|
|
?. =('---' i.wan) [~ (of-wain wan)]
|
2016-01-26 03:52:58 +03:00
|
|
|
|- ^+ [atr mud='']
|
|
|
|
?~ t.wan ~|(%unclosed-metadata !!)
|
2016-12-03 01:14:39 +03:00
|
|
|
?: =('---' i.t.wan) [atr (of-wain t.t.wan)]
|
2016-01-26 03:52:58 +03:00
|
|
|
?^ (rush i.t.wan (star ace))
|
|
|
|
$(wan t.wan)
|
|
|
|
=- $(wan t.wan, atr (~(put by atr) (crip key) (crip val)))
|
|
|
|
~| malformed-attribute+i.t.wan
|
2020-11-26 17:09:31 +03:00
|
|
|
^- [key=tape ^ val=tape]
|
2016-01-26 03:52:58 +03:00
|
|
|
+>:(atr-key 1^1 (trip i.t.wan))
|
|
|
|
--
|