shrub/pkg/arvo/mar/graph/validator/publish.hoon
Liam Fitzgerald 905ce6dc2d
hark: update mark conversion for editable comments
Updated mark conversion so that edits to comments are notified
separately to new comments.
2020-11-25 12:21:37 +10:00

62 lines
1.2 KiB
Plaintext

/- *post
|_ i=indexed-post
++ grow
|%
++ noun i
:: +notification-kind
:: Ignore all containers, only notify on content
::
++ notification-kind
?+ index.p.i ~
[@ %1 %1 ~] `[%note 0]
[@ %1 @ ~] `[%edit-note 0]
[@ %2 @ %1 ~] `[%comment 1]
[@ %2 @ @ ~] `[%edit-comment 1]
==
--
++ grab
|%
:: +noun: Validate publish post
::
++ noun
|= p=*
=/ ip ;;(indexed-post p)
?+ index.p.ip !!
:: top level post must have no content
[@ ~]
?> ?=(~ contents.p.ip)
ip
:: container for revisions
::
[@ %1 ~]
?> ?=(~ contents.p.ip)
ip
:: specific revision
:: first content is the title
:: revisions are numbered by the revision count
:: starting at one
[@ %1 @ ~]
?> ?=([* * *] contents.p.ip)
?> ?=(%text -.i.contents.p.ip)
ip
:: container for comments
::
[@ %2 ~]
?> ?=(~ contents.p.ip)
ip
:: container for comment revisions
::
[@ %2 @ ~]
?> ?=(~ contents.p.ip)
ip
:: specific comment revision
::
[@ %2 @ @ ~]
?> ?=(^ contents.p.ip)
ip
==
--
::
++ grad %noun
--