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

59 lines
1.2 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))
(cat 3 'last-modified: ' (scot %da last-modified.com))
2019-07-11 21:32:30 +03:00
'-----'
(to-wain:format body.com)
==
--
++ 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
last-modified=@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)
==
::
%+ rash last-modified.txs
;~ pfix
(jest 'last-modified: ~')
(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
--