story: add lib/story.hoon

This commit is contained in:
Yaseen 2022-01-26 11:37:02 -05:00
parent 5b512abae5
commit b0a666d2eb

View File

@ -0,0 +1,36 @@
/- *story
|%
++ tako-to-text
|= [=tako:clay]
^- cord
"commit: {<`@uv`tako>}\0a"
++ proses-to-text
|= [proses=(set prose)]
^- cord
:: XX code cleanup: factor out duplicate code
=/ proses-list=(list prose) ~(tap in proses)
?: ?=(~ proses-list) ''
?: ?=([prose ~] proses-list)
=/ [title=@t body=@t] i.proses-list
%- crip
;: welp
"{(trip title)}"
"\0a\0a"
"{(trip body)}"
"\0a"
==
%- crip
%- tail
%^ spin ;;((list prose) proses-list) *tape :: WHY DO WE NEED ;;
|= [[title=@t body=@t] state=tape]
^- [prose tape]
:- [title body]
;: welp
state
"|||\0a"
"{(trip title)}"
"\0a\0a"
"{(trip body)}"
"\0a"
==
--