mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-09-20 23:18:00 +03:00
add json translation for frontend use
This commit is contained in:
parent
b886daf7c0
commit
730af1b93f
@ -16,10 +16,20 @@
|
||||
:+ (cat 3 'User ' ?~(who 'of Urbit' who))
|
||||
(cat 3 'Location ' (moon ?~(loc /unknown loc)))
|
||||
%+ turn (sort (~(tap by acc)) aor)
|
||||
|= {a/knot b/iden c/(unit purf)} ^- cord
|
||||
|= {a/knot b/plan-acct} ^- cord
|
||||
%+ rap 3
|
||||
:^ a ': ' b
|
||||
?~(c ~ [', ' (earf u.c)])
|
||||
:^ a ': ' usr.b
|
||||
?~(url.b ~ [', ' (earf u.url.b)])
|
||||
::
|
||||
++ plan-json
|
||||
%- jobe :~
|
||||
who+?~(who ~ s+who)
|
||||
loc+?~(loc ~ s+(moon loc))
|
||||
acc+o+(~(run by acc) json-acct)
|
||||
==
|
||||
++ json-acct :: helper
|
||||
|= a/plan-acct ^- json
|
||||
(jobe usr+s+usr.a url+?~(url.a ~ (jape (earf u.url.a))) ~)
|
||||
--
|
||||
++ grab |% :: convert from
|
||||
++ noun {{cord govt} (map knot plan-acct)} :: clam from %noun
|
||||
|
@ -9,6 +9,7 @@
|
||||
/= sect /&json&/tree-index/
|
||||
/= snip /&snip&elem&/tree-elem/
|
||||
/= meta /&json&front&/|(/front/ /~[~])
|
||||
/= plan /^ json /|(/plan-json/ /~[~])
|
||||
/= comt /&json&/tree-comments/
|
||||
!:
|
||||
^- tree-include
|
||||
@ -20,4 +21,5 @@
|
||||
meta
|
||||
sect
|
||||
comt
|
||||
plan
|
||||
==
|
||||
|
@ -21,6 +21,7 @@
|
||||
{$spur $t}
|
||||
::
|
||||
{$comt $j}
|
||||
{$plan $j}
|
||||
{$head $r}
|
||||
{$sect $j}
|
||||
{$snip $r}
|
||||
@ -53,6 +54,7 @@
|
||||
$name (from-type +.a ?^(s.bem i.s.bem q.bem))
|
||||
$path (from-type +.a (crip (spud (flop s.bem))))
|
||||
$spur (from-type +.a (crip (spud s.bem)))
|
||||
$plan (from-type +.a plan.dat)
|
||||
$comt (from-type +.a comt.dat)
|
||||
$head (from-type +.a head.dat)
|
||||
$snip (from-type +.a snip.dat)
|
||||
|
@ -1 +1 @@
|
||||
{iden (unit purf)}
|
||||
{usr/iden url/(unit purf)}
|
||||
|
@ -10,4 +10,5 @@ $: mime/mime
|
||||
meta/json
|
||||
sect/json
|
||||
comt/json
|
||||
plan/json
|
||||
==
|
||||
|
Loading…
Reference in New Issue
Block a user