Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NIP-84: Highlights #501

Merged
merged 7 commits into from
Nov 7, 2023
Merged

NIP-84: Highlights #501

merged 7 commits into from
Nov 7, 2023

Conversation

pablof7z
Copy link
Member

@pablof7z pablof7z commented May 5, 2023

This NIP introduces kind:9802 Highlight event as implemented by https://highlighter.com and https://habla.news

kind:9802 events are highlights of nostr events' content (e.g., kind:1 or kind:30023) or URLs, signaling content of importance to a user.

NIP text: https://github.com/pablof7z/nips/blob/highlights/84.md

@fiatjaf @verbiricha

Copy link
Member

@staab staab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we already have a NIP for bookmarks (other than e lists)? This seems like a more granular form of the same thing. Fully support it though.

84.md Outdated
[ "range", 42, 84, "context" ] # highlight begins at index position 42 of the `context` tag's value
```

#### Non-text-based nostr events's highlights
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

events'

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

damn it! 😂 thanks

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You missed a chance to use the most amazing feature of the English language.

Comment on lines +36 to +37
Clients MAY include a `context` tag, useful when the highlight is a subset of a paragraph and displaying the
surrounding content might be beneficial to give context to the higlight.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe clarify that this is a larger text excerpt of the original content, that wasn't immediately obvious to me. Or just refer to the example below.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yeah, good point

#### Non-text-based nostr events's highlights

A `kind:9802` event that tags a NIP-94 event which includes a video or audio file can use ranges to
indicate the start/end time position in seconds.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we include a tag that marks the highlight as audio/video? It seems to me that audio/video refs could be r (youtube link), a (replaceable event representing a track) or e (NIP-94 audio/video file).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pablof7z can you answer this?

@verbiricha
Copy link
Member

Do we already have a NIP for bookmarks (other than e lists)? This seems like a more granular form of the same thing. Fully support it though.

Yes, NIP-51 categorized bookmark lists

@staab
Copy link
Member

staab commented Jun 19, 2023

Next release of Coracle will have support for rendering highlights.

Comment on lines +30 to +32
[ "p", "...", "author" ],
[ "p", "...", "author" ],
[ "p", "...", "editor" ],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[ "p", "...", "author" ],
[ "p", "...", "author" ],
[ "p", "...", "editor" ],
[ "p", "...", "<recommended relay URL>", "author" ],
[ "p", "...", "<recommended relay URL>", "author" ],
[ "p", "...", "<recommended relay URL>", "editor" ],

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pablof7z please ack here.

`a` or `e` tags should be used for nostr events and `r` tags for URLs.

When tagging a URL, clients generating these events SHOULD do a best effort of cleaning the URL from trackers
or obvious non-useful information from the query string.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it is a good idea to say that r urls should remove trailing slash so to ease querying.
So https://footstr.com/zapvertise/ -> https://footstr.com/zapvertise
And https://example.com/?article=987 -> https://example.com?article=987

Copy link
Member

@fiatjaf fiatjaf Jun 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And also normalize/sort the query strings, remove the # section, port names, prefer https?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. Remove port if 80 (http) or 443 (https) only.

@fiatjaf
Copy link
Member

fiatjaf commented Jun 19, 2023

Is this a thing? I think I missed this NIP entirely.

@pablof7z
Copy link
Member Author

Is this a thing? I think I missed this NIP entirely.

with support on amethyst, highlighter, habla and soon(TM) coracle 😉

@fiatjaf
Copy link
Member

fiatjaf commented Jun 19, 2023

Is the NIP number a reference to some historical event?

@pablof7z
Copy link
Member Author

Is the NIP number a reference to some historical event?

haha, no, this one is random and has no special meaning 😅

Co-authored-by: Alejandro <[email protected]>
fiatjaf and others added 4 commits June 19, 2023 16:10
Co-authored-by: Alejandro <[email protected]>
Co-authored-by: arthurfranca <[email protected]>
Co-authored-by: arthurfranca <[email protected]>
Copy link
Member

@staab staab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I implemented support for this in Coracle yesterday, one thing I'd like to see is an alt/summary/comment tag that allows people to leave a note about the highlight (like a quote tweet). I left a note on highlighter about a highlight, but it didn't show up on the event itself.

@sroertgen
Copy link

Any specific reason why this is not merged yet?
@pablof7z @fiatjaf @verbiricha @arthurfranca

@pablof7z
Copy link
Member Author

I need to update some stuff based on comments but totally forgot; I'll do it soon so we can merge

@pablof7z
Copy link
Member Author

I implemented support for this in Coracle yesterday, one thing I'd like to see is an alt/summary/comment tag that allows people to leave a note about the highlight (like a quote tweet). I left a note on highlighter about a highlight, but it didn't show up on the event itself.

I do this with a kind 1 quoting the kind 9802.

@fiatjaf fiatjaf merged commit b128ad9 into nostr-protocol:master Nov 7, 2023
@alltheseas
Copy link
Contributor

alltheseas commented Jun 25, 2024

@pablof7z

Does the spec allow for combination of a quote note (I believe this is 'q' tag x NIP-18) functionality + highlight functionality?

For instance, if I quote a few words from a note, does NIP-84 specify a way to combine quote note functionality that I can display with the highlight, so that I can add my commentary to the highlight?

Example mockup:

qn

cc @ericholguin

@pablof7z
Copy link
Member Author

quote highlights are kind:1s that q tag a kind:9802 and have a [ "k", "9802" ] tag. I added some examples in nevent1qgs04xzt6ldm9qhs0ctw0t58kf4z57umjzmjg6jywu0seadwtqqc75spz3mhxw309akx7cmpd35x7um58g6n2deh9uqzqh3mxdlhenu4u7ph2je80qkvplrlaysapjm2lp5uf35y9qkgml4vx7gzjg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants