urbit/pkg/arvo/sur/link.hoon
Fang 9f18877c0a
link: rudimentary comments
As of yet largely untested. The "urls in paths" might bring trouble.
2019-12-21 00:52:09 +01:00

74 lines
1.5 KiB
Plaintext

:: link: social bookmarking
::
:: link operates on the core structure of "pages", which are URLs saved at a
:: specific time with a specific title.
:: submissions, then, are pages received from a specific ship.
::
|%
:: primitives
::
+$ url @t
+$ site @t :: domain, host, etc.
:: +page: a saved URL with timestamp and custom title
::
+$ page
$: title=@t
=url
=time
==
:: +submission: a page saved by a ship
::
+$ submission
$: =ship
page
==
:: +note: a comment on some url
+$ note
$: =time
udon=@t
==
:: +comment: a comment by a ship on some url
::
+$ comment
$: =ship
note
==
:: lists, reverse chronological / newest first
::
+$ pages (list page)
+$ submissions (list submission)
+$ notes (list note)
+$ comments (list comment)
::
:: +action: local actions
::
+$ action
$% :: user actions
::
:: %save: save page to path on our ship
::
[%save =path title=@t =url]
:: %note: save a note for a url
::
[%note =path =url udon=@t]
:: hook actions
::
:: %hear: hear about page at path on other ship
::
[%hear =path submission]
:: %read: hear about note on url from ship
::
[%read =path =url comment]
==
:: +update: local updates
::
::NOTE we include paths/urls to support the "subscribed to all" case
::
+$ update
$% [%local-pages =path =pages]
[%submissions =path =submissions]
[%annotations =path =url =notes]
[%discussions =path =url =comments]
==
--