From a2cc5d533340c266891711d1b53c775526755d75 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Fri, 19 Feb 2016 12:01:52 -0800 Subject: [PATCH] move tree-comments to separate renderer --- mar/tree/comments.hoon | 23 +++++++++++++++++++++++ ren/tree/combine.hoon | 6 ++---- ren/tree/comments.hoon | 9 +++++++++ 3 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 mar/tree/comments.hoon create mode 100644 ren/tree/comments.hoon diff --git a/mar/tree/comments.hoon b/mar/tree/comments.hoon new file mode 100644 index 000000000..1134ee7ac --- /dev/null +++ b/mar/tree/comments.hoon @@ -0,0 +1,23 @@ +:: +:::: /hoon/comments/tree/mar + :: +/? 310 +/+ react +!: +:::: + :: +|_ all/(list (pair time manx)) +:: +++ grow :: convert to + |% + ++ json + :- %a + %+ turn + (sort all |=({a/* b/*} (lor b a))) + |= {a/time b/manx} ^- ^json + (jobe time+(jode a) body+(react-to-json:react b) ~) + -- +++ grab |% :: convert from + ++ noun (list {time manx}) :: clam from %noun + ::++ elem |=(a=manx `_all`[[/ ((getall %h1) a)] ~ ~]) +-- -- diff --git a/ren/tree/combine.hoon b/ren/tree/combine.hoon index ae55af7f7..7153d1cc4 100644 --- a/ren/tree/combine.hoon +++ b/ren/tree/combine.hoon @@ -9,17 +9,15 @@ /= sect /&json&/tree-index/ /= snip /&snip&elem&/tree-elem/ /= meta /&json&front&/|(/front/ /~[~]) -/= comt /^ (list (pair time manx)) - /: /%/comments /@ /&elem&/md/ +/= comt /&json&/tree-comments/ !: ^- tree-include =+ rj=react-to-json:react -=+ 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 meta sect - [%a (turn (sort comt |=({a/* b/*} (lor b a))) cj)] + comt == diff --git a/ren/tree/comments.hoon b/ren/tree/comments.hoon new file mode 100644 index 000000000..a51fb6647 --- /dev/null +++ b/ren/tree/comments.hoon @@ -0,0 +1,9 @@ +:: +:::: /hoon/comments/tree/ren + :: +/? 310 +/: /%/comments /@ /&elem&/md/ :: XX descend horn +:: +:::: + :: +`(list (pair time manx))`-.-