urbit/pkg/arvo/mar/graph/validator/publish.hoon

47 lines
906 B
Plaintext
Raw Normal View History

/- *post
|_ i=indexed-post
++ grow
|%
++ noun i
--
++ grab
|%
:: +noun: Validate publish post
::
++ noun
|= p=*
=/ ip ;;(indexed-post p)
2020-09-08 09:08:52 +03:00
?+ index.p.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 @ ~]
2020-10-05 07:53:46 +03:00
?> ?=([* * ~] contents.p.ip)
2020-09-08 09:08:52 +03:00
?> ?=(%text -.i.contents.p.ip)
2020-10-29 02:32:15 +03:00
?> ?=(%text -.i.t.contents.p.ip)
2020-09-08 09:08:52 +03:00
ip
:: container for comments
[@ %2 ~]
?> ?=(~ contents.p.ip)
ip
:: comment
2020-10-05 07:53:46 +03:00
[@ %2 @ ~]
?> ?=([* ~] contents.p.ip)
?> ?=(%text -.i.contents.p.ip)
ip
:: top level post must have no content
[@ ~]
?> ?=(~ contents.p.ip)
ip
2020-09-08 09:08:52 +03:00
==
--
::
++ grad %noun
--