urbit/pkg/arvo/mar/publish/comment.hoon

51 lines
1.0 KiB
Plaintext
Raw Normal View History

2019-07-12 01:07:05 +03:00
/- publish
|_ com=comment:publish
2019-07-11 21:32:30 +03:00
::
::
++ grow
|%
++ mime
2019-07-12 01:07:05 +03:00
:- /text/x-publish-comments
2019-07-11 21:32:30 +03:00
(as-octs:mimes:html (of-wain:format txt))
++ txt
^- wain
:* (cat 3 'author: ' (scot %p author.com))
(cat 3 'date-created: ' (scot %da date-created.com))
2019-07-11 21:32:30 +03:00
'-----'
2019-12-14 01:27:37 +03:00
(to-wain:format content.com)
2019-07-11 21:32:30 +03:00
==
--
++ grab
|%
++ mime
|= [mite:eyre p=octs:eyre]
(txt (to-wain:format q.p))
++ txt
|= txs=(pole @t)
2019-07-12 01:07:05 +03:00
^- comment:publish
2019-07-11 21:32:30 +03:00
:: TODO: putting ~ instead of * breaks this but shouldn't
::
?> ?= $: author=@t
2019-07-11 21:32:30 +03:00
date-created=@t
line=@t
body=*
==
txs
?> =(line.txs '-----')
2019-07-11 21:32:30 +03:00
::
:* %+ rash author.txs
;~(pfix (jest 'author: ~') fed:ag)
2019-07-11 21:32:30 +03:00
::
%+ rash date-created.txs
;~ pfix
(jest 'date-created: ~')
(cook year when:so)
==
::
(of-wain:format (wain body.txs))
2019-07-11 21:32:30 +03:00
==
2019-07-12 01:07:05 +03:00
++ noun comment:publish
2019-07-11 21:32:30 +03:00
--
++ grad %mime
--