2018-08-29 01:13:26 +03:00
|
|
|
::
|
|
|
|
:::: /ren/collections/item/hoon
|
|
|
|
::
|
|
|
|
/? 309
|
2018-07-31 07:00:49 +03:00
|
|
|
/+ collections
|
2018-08-29 01:13:26 +03:00
|
|
|
::
|
2019-01-18 08:37:34 +03:00
|
|
|
:: item:
|
2018-08-29 01:13:26 +03:00
|
|
|
::
|
2019-01-18 08:37:34 +03:00
|
|
|
:: render a collection-item at this path
|
2018-08-29 01:13:26 +03:00
|
|
|
:: outputs a +item defined in /lib/collections/hoon
|
|
|
|
::
|
|
|
|
:: recursive renderer, see its counterpart in /ren/collections/hoon
|
|
|
|
::
|
2018-07-31 07:00:49 +03:00
|
|
|
/= item
|
|
|
|
/^ item:collections
|
2018-08-29 01:13:26 +03:00
|
|
|
::
|
|
|
|
:: run a gate which checks if the output of the renderers below are null or not,
|
|
|
|
:: crash in the case that both are null
|
|
|
|
:: tag them with %collection, %raw, or %both for the 3 remaining permissible cases,
|
|
|
|
::
|
2018-07-31 07:00:49 +03:00
|
|
|
/; |= $: raw=?(~ raw-item:collections)
|
|
|
|
col=?(~ collection:collections)
|
|
|
|
~
|
|
|
|
==
|
|
|
|
?~ raw
|
|
|
|
?~ col
|
2018-11-07 09:55:34 +03:00
|
|
|
[%error ~]
|
2018-07-31 07:00:49 +03:00
|
|
|
[%collection col]
|
|
|
|
?~ col
|
|
|
|
[%raw raw]
|
|
|
|
[%both col raw]
|
|
|
|
::
|
2018-08-29 01:13:26 +03:00
|
|
|
:: run a pair of renderers
|
|
|
|
::
|
2018-11-07 21:47:29 +03:00
|
|
|
:: 1. get a .udon file together with its frontmatter, or else return ~
|
2018-08-29 01:13:26 +03:00
|
|
|
::
|
|
|
|
:: 2. run the collections renderer, if it fails return ~
|
|
|
|
:: (it fails if .collections-config file does not exist at this path)
|
|
|
|
::
|
2018-07-31 07:00:49 +03:00
|
|
|
/.
|
|
|
|
::
|
2018-08-29 01:13:26 +03:00
|
|
|
/| /; |= [a=(map knot cord) b=@t ~]
|
2018-11-07 21:47:29 +03:00
|
|
|
[%udon a b]
|
2018-08-29 01:13:26 +03:00
|
|
|
/. /front/
|
2018-11-07 21:47:29 +03:00
|
|
|
/udon/
|
2018-08-29 01:13:26 +03:00
|
|
|
==
|
|
|
|
/~ ~
|
|
|
|
==
|
2018-07-31 07:00:49 +03:00
|
|
|
::
|
2018-08-29 01:13:26 +03:00
|
|
|
/| /collections/
|
|
|
|
/~ ~
|
|
|
|
==
|
2018-07-31 07:00:49 +03:00
|
|
|
::
|
|
|
|
==
|
|
|
|
::
|
|
|
|
item
|