mirror of
https://github.com/urbit/shrub.git
synced 2024-12-01 14:42:02 +03:00
added comment hash identifier
This commit is contained in:
parent
a5a058d7da
commit
1cf56bd06b
@ -3,7 +3,7 @@
|
||||
:: :: ::
|
||||
/? 310
|
||||
/- talk, sole
|
||||
/+ talk, sole
|
||||
/+ talk, sole, time-to-id
|
||||
/= seed /~ !>(.)
|
||||
::
|
||||
::::
|
||||
@ -1303,14 +1303,15 @@
|
||||
[our.hid %hood]
|
||||
[%write-comment pax src.hid txt]
|
||||
==
|
||||
=+ =+(xap=(flop pax) ?~(xap nam="/" nam=<i.xap>))
|
||||
=+ =+(xap=(flop pax) ?~(xap nam="" nam=<i.xap>)) :: file name
|
||||
=+ fra=(crip (time-to-id now.hid)) :: url fragment
|
||||
%+ ra-record (main our.hid)
|
||||
:^ src.hid (shaf %comt eny.hid)
|
||||
[[[%& our.hid (main our.hid)] *envelope %pending] ~ ~]
|
||||
:+ now.hid (sy /comment eyre+pax ~)
|
||||
:- %mor :~
|
||||
[%app %tree (crip "comment on {nam}")]
|
||||
[%fat text+(lore txt) [%url [ra-base-hart `pax ~] ~]]
|
||||
[%fat text+(lore txt) [%url [ra-base-hart `pax ~] `fra]]
|
||||
[%app %tree (crip "comment on /{nam}")]
|
||||
==
|
||||
::
|
||||
++ ra-know :: story monad
|
||||
|
10
lib/time-to-id.hoon
Normal file
10
lib/time-to-id.hoon
Normal file
@ -0,0 +1,10 @@
|
||||
:: Use lower bits of @da as hash identifier
|
||||
::
|
||||
:::: /hoon/time-to-id/lib
|
||||
::
|
||||
/? 310
|
||||
!:
|
||||
:::: ~fyr
|
||||
::
|
||||
|= a/time ^- tape
|
||||
['c' (s-co:co f:(yell a))]
|
@ -2,7 +2,7 @@
|
||||
:::: /hoon/comments/tree/mar
|
||||
::
|
||||
/? 310
|
||||
/+ react
|
||||
/+ react, time-to-id
|
||||
!:
|
||||
::::
|
||||
::
|
||||
@ -15,6 +15,7 @@
|
||||
%+ turn
|
||||
(sort all |=({a/* b/*} (lor b a)))
|
||||
|= {a/time b/manx} ^- ^json
|
||||
=. a.g.b [id+(time-to-id a) a.g.b]
|
||||
(jobe time+(jode a) body+(react-to-json:react b) ~)
|
||||
--
|
||||
++ grab |% :: convert from
|
||||
|
Loading…
Reference in New Issue
Block a user