shrub/tree/json.hook
2015-07-27 15:39:36 -07:00

53 lines
1005 B
Plaintext

::
/? 314
/= gas /$ fuel
/= ral /: /=== /% /react-json/
/= pal /: /===
/^ (map ,@ta json)
/% 2
/_ /react-json/
::
/= sal /: /===
/^ (map ,@ta json)
/% 2
/_ /react-snips-json/
::
::::
::
// /%%/util
::
[util=. +>]
::
!:
::::
::
^- json
=+ ~(. util gas)
:: .json?kids
?: (~(has by qix.gas) %kids)
%+ joba %kids
=. pal (~(del by pal) %md) :: XX haxor
=- [%a (turn (~(tap by pal)) -)]
|= [a=span b=json]
%- jobe :~
name/s/a
body/b
==
:: .json?snip
?: (~(has by qix.gas) %snip)
%+ joba %snip
=. sal (~(del by sal) %md) :: XX haxor
=- [%a (turn (~(tap by sal)) -)]
|= [a=span b=json]
=+ fon=(json-front b)
%- jobe :~
meta/fon
name/s/a
body/b
==
:: .json
%- jobe :~
kids/[%a (turn get-kids |=(a=span s/a))]
body/ral
==