urbit/mar/collections/config.hoon

44 lines
1.3 KiB
Plaintext
Raw Normal View History

2017-12-02 21:45:47 +03:00
:: /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)
2017-12-14 04:11:13 +03:00
:^ (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))
2017-12-02 21:45:47 +03:00
--
::
++ grab
|%
++ mime
|= {p/mite:eyre q/octs:eyre}
(txt (to-wain:format q.q))
++ txt
2017-12-14 04:11:13 +03:00
|= 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
2017-12-14 04:14:27 +03:00
%+ turn (skip mem.txs |=(a=@t =(a ''))) :: skip trailing blank
2017-12-14 04:11:13 +03:00
(curr rash ;~(pfix (jest ' ~') fed:ag))
2017-12-02 21:45:47 +03:00
--
++ grad %txt
--