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

85 lines
2.0 KiB
Plaintext
Raw Normal View History

::
2019-07-12 01:07:05 +03:00
:::: /hoon/info/publish/mar
::
2019-07-12 01:07:05 +03:00
/- publish
!:
2019-07-12 01:07:05 +03:00
|_ con=collection-info:publish
::
::
++ grow
|%
++ mime
2019-07-12 01:07:05 +03:00
:- /text/x-publish-info
(as-octs:mimes:html (of-wain:format txt))
++ txt
^- wain
:~ (cat 3 'owner: ' (scot %p owner.con))
(cat 3 'title: ' title.con)
(cat 3 'filename: ' filename.con)
(cat 3 'comments: ' comments.con)
(cat 3 'allow-edit: ' allow-edit.con)
(cat 3 'date-created: ' (scot %da date-created.con))
(cat 3 'last-modified: ' (scot %da last-modified.con))
==
--
++ 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
^- collection-info:publish
:: TODO: putting ~ instead of * breaks this but shouldn't
::
?> ?= $: owner=@t
title=@t
filename=@t
comments=@t
allow-edit=@t
date-created=@t
last-modified=@t
*
==
txs
::
:* %+ rash owner.txs
;~(pfix (jest 'owner: ~') fed:ag)
::
2020-01-04 00:06:42 +03:00
%+ rash title.txs
;~(pfix (jest 'title: ') (cook crip (star next)))
::
2020-01-04 00:06:42 +03:00
%+ rash filename.txs
;~(pfix (jest 'filename: ') (cook crip (star next)))
::
%+ rash comments.txs
;~ pfix
(jest 'comments: ')
2019-07-12 01:07:05 +03:00
%+ cook comment-config:publish
;~(pose (jest %open) (jest %closed) (jest %none))
==
::
%+ rash allow-edit.txs
;~ pfix
(jest 'allow-edit: ')
2019-07-12 01:07:05 +03:00
%+ cook edit-config:publish
;~(pose (jest %post) (jest %comment) (jest %all) (jest %none))
==
::
%+ rash date-created.txs
;~ pfix
(jest 'date-created: ~')
(cook year when:so)
==
::
%+ rash last-modified.txs
;~ pfix
(jest 'last-modified: ~')
(cook year when:so)
==
==
2019-07-12 01:07:05 +03:00
++ noun collection-info:publish
--
++ grad %mime
--