diff --git a/app/hood.hoon b/app/hood.hoon index e4ac5b005..c8186e3e5 100644 --- a/app/hood.hoon +++ b/app/hood.hoon @@ -149,6 +149,7 @@ ++ poke-write-sec-atom (wrap poke-sec-atom):from-write ++ poke-write-paste (wrap poke-paste):from-write ++ poke-write-comment (wrap poke-comment):from-write +++ poke-write-fora-post (wrap poke-fora-post):from-write ++ poke-write-plan-info (wrap poke-plan-info):from-write ++ poke-write-plan-account (wrap poke-plan-account):from-write ++ poke-write-tree (wrap poke-tree):from-write diff --git a/app/talk.hoon b/app/talk.hoon index 682d9b786..75172260f 100644 --- a/app/talk.hoon +++ b/app/talk.hoon @@ -73,6 +73,7 @@ ++ pear :: poke fruit $% {$talk-command command} :: {$write-comment spur ship cord} :: + {$write-fora-post spur ship cord cord} :: == :: ++ card :: general card $% {$diff lime} :: @@ -1331,6 +1332,47 @@ ?:(neu +>.$ ra-homes) :: ++ ra-base-hart .^(hart %e /(scot %p our.hid)/host/(scot %da now.hid)) + ++ ra-fora-post + |= {pax/path sup/spur hed/@t txt/@t} + =. ..ra-emit + %+ ra-emit ost.hid + :* %poke + /fora-post + [our.hid %hood] + [%write-fora-post sup src.hid hed txt] + == + =+ man=%posts + ?: (~(has by stories) man) + (ra-consume-fora-post man pax sup hed txt) + =; new (ra-consume-fora-post:new man pax sup hed txt) + =. ..ra-apply + %+ ra-apply our.hid + :+ %design man + :- ~ :- ~ + :- 'towards a community' + [%brown ~] + %^ ra-consume & our.hid + :^ (shaf %init eny.hid) + (my [[%& our.hid (main our.hid)] *envelope %pending] ~) + now.hid + [~ %app %tree 'receiving forum posts, ;join %posts for details'] + :: + ++ ra-consume-fora-post + |= {man/knot pax/path sup/spur hed/@t txt/@t} ^+ +> + =+ nam=?~(sup "" (trip i.sup)) :: file name + =+ fra=(crip (time-to-id now.hid)) :: url fragment + %^ ra-consume & + src.hid + :* (shaf %comt eny.hid) + (my [[%& our.hid man] *envelope %pending] ~) + now.hid + (sy /fora-post eyre+pax ~) + :- %mor :~ + [%fat text+(lore txt) [%url [ra-base-hart `pax ~] `fra]] + [%app %tree (crip "forum post: '{(trip hed)}'")] + == + == + :: ++ ra-comment |= {pax/path sup/spur txt/@t} =. ..ra-emit @@ -1343,19 +1385,18 @@ =+ man=%comments ?: (~(has by stories) man) (ra-consume-comment man pax sup txt) + =; new (ra-consume-comment:new man pax sup txt) =. ..ra-apply %+ ra-apply our.hid :+ %design man :- ~ :- ~ :- 'letters to the editor' [%brown ~] - =. ..ra-consume - %^ ra-consume & our.hid - :^ (shaf %init eny.hid) - (my [[%& our.hid (main our.hid)] *envelope %pending] ~) - now.hid - [~ %app %tree 'receiving comments, ;join %comments for details'] - (ra-consume-comment man pax sup txt) + %^ ra-consume & our.hid + :^ (shaf %init eny.hid) + (my [[%& our.hid (main our.hid)] *envelope %pending] ~) + now.hid + [~ %app %tree 'receiving comments, ;join %comments for details'] :: ++ ra-consume-comment |= {man/knot pax/path sup/spur txt/@t} ^+ +> @@ -2259,6 +2300,10 @@ |= {pax/path sup/spur txt/@t} ^- (quip move +>) ra-abet:(ra-comment:ra pax sup txt) :: +++ poke-talk-fora-post + |= {pax/path sup/spur hed/@t txt/@t} ^- (quip move +>) + ra-abet:(ra-fora-post:ra pax sup hed txt) +:: ++ poke-talk-save |= man/knot ^- (quip move +>) diff --git a/lib/write.hoon b/lib/write.hoon index 2d553174e..5b13dc059 100644 --- a/lib/write.hoon +++ b/lib/write.hoon @@ -86,6 +86,24 @@ == (poke--data [`%md pax] %mime / (taco txt)) :: +++ poke-fora-post + |= {sup/spur him/ship hed/@t txt/@t} ^+ abet + =+ pax=(welp (flop sup) /posts/(scot %da now)) + =. txt + %- crip + """ + --- + type: post + date: {} + title: {(trip hed)} + author: {} + comments: true + --- + + {(trip txt)} + """ + (poke--data [`%md pax] %mime / (taco txt)) +:: ++ ames-secret ^- @t =- (crip +:<.^(@p %a pax)>) diff --git a/mar/talk/fora-post.hoon b/mar/talk/fora-post.hoon new file mode 100644 index 000000000..9de392ed2 --- /dev/null +++ b/mar/talk/fora-post.hoon @@ -0,0 +1,13 @@ +:: +:::: /hoon/fora-post/talk/mar + :: +/? 310 +!: +|_ {pax/path sup/spur hed/@t txt/@t} +++ grab + |% + ++ noun {path spur @t @t} + ++ json + (corl need =>(jo (ot pax+(su fel:stab) sup+(su fel:stab) hed+so txt+so ~))) + -- +--