frontload frontmatter

This commit is contained in:
Anton Dyudin 2015-07-17 17:19:25 -07:00
parent 59ff12eed2
commit 0ef3333095
3 changed files with 22 additions and 3 deletions

View File

@ -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

View File

@ -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
==

View File

@ -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