mirror of
https://github.com/urbit/shrub.git
synced 2024-12-18 15:55:00 +03:00
story: fix to-text arms
This commit is contained in:
parent
9286d89fa2
commit
75d6882b51
@ -24,8 +24,8 @@
|
||||
%- some
|
||||
%- crip
|
||||
;: welp
|
||||
(trip (tako-to-text:lib r.commit))
|
||||
(trip (proses-to-text:lib u.proses))
|
||||
(tako-to-text:lib r.commit)
|
||||
(proses-to-text:lib u.proses)
|
||||
==
|
||||
::::
|
||||
:: Remarks:
|
||||
|
@ -2,32 +2,34 @@
|
||||
|%
|
||||
++ tako-to-text
|
||||
|= [=tako:clay]
|
||||
^- cord
|
||||
(crip "commit: {<`@uv`tako>}\0a")
|
||||
^- tape
|
||||
"commit: {<`@uv`tako>}\0a"
|
||||
::
|
||||
++ proses-to-text
|
||||
|= [proses=(set prose)]
|
||||
^- cord
|
||||
:: XX code cleanup: factor out duplicate code
|
||||
|= [=proses]
|
||||
^- tape
|
||||
=/ proses-list=(list prose) ~(tap in proses)
|
||||
?: ?=(~ proses-list) ''
|
||||
?: ?=(~ proses-list) ""
|
||||
?: ?=([prose ~] proses-list)
|
||||
=/ [title=@t body=@t] i.proses-list
|
||||
%- crip
|
||||
;: welp
|
||||
"{(trip title)}"
|
||||
"\0a\0a"
|
||||
"{(trip body)}"
|
||||
"\0a"
|
||||
==
|
||||
%- crip
|
||||
(prose-to-text i.proses-list)
|
||||
%- tail
|
||||
%^ spin ;;((list prose) proses-list) *tape :: WHY DO WE NEED ;;
|
||||
|= [[title=@t body=@t] state=tape]
|
||||
%^ spin ;;((list prose) t.proses-list) :: XX WHY DO WE NEED ;;
|
||||
(prose-to-text i.proses-list)
|
||||
|= [prz=prose state=tape]
|
||||
^- [prose tape]
|
||||
:- [title body]
|
||||
:- prz
|
||||
;: welp
|
||||
state
|
||||
"|||\0a"
|
||||
"|||"
|
||||
"\0a"
|
||||
(prose-to-text prz)
|
||||
==
|
||||
::
|
||||
++ prose-to-text
|
||||
|= pro=prose
|
||||
=/ [title=@t body=@t] pro
|
||||
^- tape
|
||||
;: welp
|
||||
"{(trip title)}"
|
||||
"\0a\0a"
|
||||
"{(trip body)}"
|
||||
|
@ -124,14 +124,14 @@
|
||||
:: XX code clean up: cleaner snoc
|
||||
%+ snoc :: ensures terminating newline is present
|
||||
%+ murn ~(tap by tale)
|
||||
|= [[=tako:clay proses=(set prose)]]
|
||||
|= [[=tako:clay =proses]]
|
||||
^- (unit cord)
|
||||
?~ proses ~
|
||||
%- some
|
||||
%- crip
|
||||
;: welp
|
||||
(trip (tako-to-text:lib tako))
|
||||
(trip (proses-to-text:lib proses))
|
||||
(tako-to-text tako)
|
||||
(proses-to-text proses)
|
||||
"---"
|
||||
==
|
||||
''
|
||||
|
Loading…
Reference in New Issue
Block a user