mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-28 11:40:11 +03:00
story: add lib/story.hoon
This commit is contained in:
parent
5b512abae5
commit
b0a666d2eb
36
pkg/base-dev/lib/story.hoon
Normal file
36
pkg/base-dev/lib/story.hoon
Normal 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"
|
||||
==
|
||||
--
|
Loading…
Reference in New Issue
Block a user