urbit / shrub

An operating function (Prototype)
https://urbit.org
MIT License
28 stars 2 forks source link

lib/manx-utils #9

Closed will-hanlen closed 3 months ago

will-hanlen commented 3 months ago

adds a forked version of ~tinnus-napbus/manx-utils

the fork adds these 3 arms:

which are useful for writing conversions from node to a poke stud.


Example:

::  con/node-txt
/@  node
/@  txt
/-  _/manx-utils
:-  [%node %txt]
|=  nod=node
^-  txt
%-  crip
(need (~(value manx-utils nod) "new-text"))  ::   THIS LINE ...
::  con/txt-htmx
::  ...
;form
  =hx-post  "/neo/hawk/{...}?stud=txt"
  ;div
    ;div           ::  can be deeply nested
      ;input
        =name  "new-text"            ::  MATCHES ON THIS ATTRIBUTE ...
        =value  "some value"         ::  THEN GETS THIS TAPE
        ;
      ==
    ==
  ==
==
:: ...
will-hanlen commented 3 months ago

what's with all the +cloop?

anything with a cloop was written by ~tinnus-napbus. but it's a loop which transforms the children of the manx in the sample.