moved some tree-combine logic to marks

This commit is contained in:
Anton Dyudin 2016-02-04 16:10:21 -08:00
parent 2a95c443ed
commit 268d62cfe5
3 changed files with 26 additions and 6 deletions

20
mar/front.hoon Normal file
View File

@ -0,0 +1,20 @@
::
:::: /hoon/front/mar
::
/? 314
!:
::::
::
|_ all=(map span cord)
::
++ grow :: convert to
|%
++ json
:- %o
%- ~(run by all)
|=(a=cord s/a)
--
++ grab |% :: convert from
++ noun (map span cord) :: clam from %noun
:: ++ elem ,~
-- --

View File

@ -1,21 +1,21 @@
/+ tree, react
/- tree-include
/+ react
/= mime /mime/
/= body /tree-elem/
/= sect /tree-index/
/= sect /&json&/tree-index/
/= snip /&snip&elem&/tree-elem/
/= meta /^ (map span cord) /|(/front/ /~[~])
/= meta /&json&front&/|(/front/ /~[~])
/= comt /^ (list (pair time manx))
/@ /&elem&md&mime&/comment-md/
!:
^- tree-include
=+ rj=react-to-json:react
=+ ij=(map-to-json:tree |=(a=path (crip (spud a))) |=(a=marl [%a (turn a rj)]))
=+ cj=|=([a=time b=manx] (jobe time/(jode a) body/(rj b) ~))
:* mime
(rj body)
(rj /h1 hed.snip) :: head
(rj /div tal.snip) :: snip
[%o (~(run by meta) |=(a=span s/a))]
(ij sect)
meta
sect
[%a (turn (sort comt lor) cj)]
==