urbit/mar/collections/config.hoon
2017-12-13 17:39:19 -08:00

49 lines
1.4 KiB
Plaintext

:: /mar/collections/config/hoon
::
|_ $= con
$: desc/cord :: description
publ/? :: public or private
visi/? :: visioverable
mems/(set ship) :: ships on list
== ::
::
++ grow
|%
++ mime
:- /text/x-collections-config
%- as-octs:mimes:html
(of-wain:format txt)
++ txt
^- (list @t)
:^ (cat 3 '> ' desc.con)
(cat 3 'public: ' ?:(publ.con 'y' 'n'))
(cat 3 'visible: ' ?:(visi.con 'y' 'n'))
:- 'except:'
%+ turn (sort ~(tap in mems.con) aor)
|= a=@p
(cat 3 ' ' (scot %p a))
++ elem :: web display
;div
;pre: {(trip (of-wain:format txt))}
;list; :: show topics
==
--
::
++ grab
|%
++ mime
|= {p/mite:eyre q/octs:eyre}
(txt (to-wain:format q.q))
++ txt
|= txs/(pole @t)
?> ?=([des=@t pub=@t vis=@t %'except:' mem=*] txs)
:^ (rash des.txs ;~(pfix (jest '> ') (cook crip (star next))))
(rash pub.txs ;~(pfix (jest 'public: ') (flag %y %n)))
(rash vis.txs ;~(pfix (jest 'visible: ') (flag %y %n)))
%- sy
%+ turn (skip mem.txs |=(a=@t =(a ''))) :: skip trailing blank
(curr rash ;~(pfix (jest ' ~') fed:ag))
--
++ grad %txt
--