mirror of
https://github.com/urbit/shrub.git
synced 2024-09-11 20:27:19 +03:00
Document node-diary-diff con
This commit is contained in:
parent
7dd1037879
commit
318c659297
@ -1,11 +1,16 @@
|
||||
/@ node
|
||||
/@ diary-diff
|
||||
/@ node :: manx
|
||||
/@ diary-diff :: ?([%put-entry id=@da txt=@t] [%del-entry id=@da])
|
||||
:: import /lib/manx-utils
|
||||
/- manx-utils
|
||||
:: declare that this is a conversion from a
|
||||
:: dynamic XML node to diary-diff
|
||||
:- [%node %$ %diary-diff]
|
||||
|= nod=node
|
||||
^- diary-diff
|
||||
=/ mu ~(. manx-utils nod)
|
||||
:: extract head, id, and text atttributes from XML node
|
||||
=/ head (@tas (got:mu %head))
|
||||
=/ id (slav %da (vol:mu "id"))
|
||||
=/ text (vol:mu "text")
|
||||
:: construct the diary-diff
|
||||
[%put-entry id text]
|
||||
|
Loading…
Reference in New Issue
Block a user