mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-15 02:48:06 +03:00
frontload frontmatter
This commit is contained in:
parent
59ff12eed2
commit
0ef3333095
@ -28,9 +28,6 @@
|
||||
?: (~(has by atr) [%urb %codemirror])
|
||||
?> ?=([[%pre *] _:/(**) ~] src)
|
||||
$(src ;codemirror(value "{v.i.a.g.i.c.src}");)
|
||||
?: (~(has by atr) [%urb %front])
|
||||
?> ?=([[%meta [%value *] *] ~] src)
|
||||
(joba %frontmatter (scan v.i.a.g.src apex:poja))
|
||||
?: (~(has by atr) [%urb %exec]) :: runnable code attribute tag
|
||||
?> ?=([[%pre *] _:/(**) ~] src) :: verify its only a text node
|
||||
=* code v.i.a.g.i.c.src
|
||||
|
@ -39,7 +39,9 @@
|
||||
=. 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
|
||||
==
|
||||
|
@ -1,5 +1,25 @@
|
||||
!:
|
||||
|_ gas=epic
|
||||
++ baff |*([a=(unit) b=(trap)] ?^(a a *b))
|
||||
++ find-in-tree
|
||||
|* [paz=fist:jo fun=$+(* (unit))]
|
||||
|= a=json ^+ *fun
|
||||
%+ biff (paz a)
|
||||
|* [b=(list json) c=*] ^+ *fun
|
||||
%+ baff (fun c)
|
||||
|.
|
||||
?~ b ~
|
||||
(baff ^^$(a i.b) |.(^$(b t.b)))
|
||||
::
|
||||
++ json-front
|
||||
|= a=json ^- json
|
||||
=- (fall `(unit json)`- ~)
|
||||
%+ biff ((ot body/some ~):jo a)
|
||||
%+ find-in-tree (ot c/(ar some) gn/so ga/(om so) ~):jo
|
||||
|= [nom=span atr=(map span cord)] ^- (unit json)
|
||||
?. (~(has by atr) 'urb:front') ~
|
||||
?> ?=(%meta nom)
|
||||
(biff (~(get by atr) %value) poja)
|
||||
::
|
||||
++ get-path
|
||||
^- path
|
||||
|
Loading…
Reference in New Issue
Block a user