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

68 lines
1.5 KiB
Plaintext
Raw Normal View History

::
2019-07-12 01:07:05 +03:00
:::: /hoon/info/publish/mar
::
2019-12-14 01:27:37 +03:00
/- *publish
!:
2019-12-14 01:27:37 +03:00
|_ info=notebook-info
::
::
++ grow
|%
++ mime
2019-07-12 01:07:05 +03:00
:- /text/x-publish-info
(as-octs:mimes:html (of-wain:format txt))
++ txt
^- wain
2019-12-14 01:27:37 +03:00
:~ (cat 3 'title: ' title.info)
(cat 3 'description: ' description.info)
(cat 3 'comments: ' ?:(comments.info 'on' 'off'))
(cat 3 'writers: ' (spat writers.info))
(cat 3 'subscribers: ' (spat subscribers.info))
==
--
++ grab
|%
++ mime
|= [mite:eyre p=octs:eyre]
(txt (to-wain:format q.p))
++ txt
|= txs=(pole @t)
2019-12-14 01:27:37 +03:00
^- notebook-info
:: TODO: putting ~ instead of * breaks this but shouldn't
::
2019-12-14 01:27:37 +03:00
?> ?= $: title=@t
description=@t
comments=@t
2019-12-14 01:27:37 +03:00
writers=@t
subscribers=@t
*
==
txs
::
2019-12-14 01:27:37 +03:00
:* %+ rash title.txs
;~(pfix (jest 'title: ') (cook crip (star next)))
::
2019-12-14 01:27:37 +03:00
%+ rash description.txs
;~(pfix (jest 'description: ') (cook crip (star next)))
::
2019-12-14 01:27:37 +03:00
%+ rash comments.txs
;~ pfix
(jest 'comments: ')
%+ cook
|= val=@t
^- ?
=(val %on)
;~(pose (jest %on) (jest %off))
==
::
2019-12-14 01:27:37 +03:00
%+ rash writers.txs
;~(pfix (jest 'writers: ') ;~(pfix net (more net urs:ab)))
::
2019-12-14 01:27:37 +03:00
%+ rash subscribers.txs
;~(pfix (jest 'subscribers: ') ;~(pfix net (more net urs:ab)))
==
2019-12-14 01:27:37 +03:00
++ noun notebook-info
--
++ grad %mime
--