The kind 9802 highlight spec doesn't include an example of a highlight, ffs.

Reply to this note

Please Login to reply.

Discussion

Fuck it we ball 🏀

Create your own and use it then document it somewhere bahaha

Well, everyone has to basically make up their own json structure. That's why they all look different.

Content and context usually contain the same text.

Maybe you can help me.

I just want to make a highlight for a web page.

https://github.com/nostr-protocol/nips/blob/master/84.md

Guess I'm just going to copy-paste one from nostr:npub1xtscya34g58tk0z605fvr788k263gsu6cy9x0mhnm87echrgufzsevkk5s and fiddle with the content.

Here's one from Gigi, but it's full of gobbledygook.

{

"content": "In a time of rising inflation and centralised control, Bitcoin offers a peaceful alternative. It is open, transparent, and accessible.",

"created_at": 1754050950,

"id": "68608e96dc4628bd3d425d35308f073411e57f564adeecdffb29368135bf384a",

"kind": 9802,

"pubkey": "6e468422dfb74a5738702a8823b9b28168abab8655faacb6853cd0ee15deee93",

"sig": "a8702c0f1401c96f7bc5fa26462ce00ab6c3011de2a6473c2072f5f380660c6d44347d5c486e4cec3d65a0759eb1734f4df9fcb6d69fd026f724ef6e4e8ca924",

"tags": [

[

"r",

"https://bitcoinbasin.nz/vision"

],

[

"textquoteselector",

"-",

" Bitcoin advocatesWhy It Matters",

" By building a thriving Bitcoin "

],

[

"textpositionselector",

"961",

"1095"

],

[

"rangeselector",

"/div[1]/div[2]/div[3]/div[2]/section[4]/p[1]",

"/div[1]/div[2]/div[3]/div[2]/section[4]/p[1]",

"0",

"134"

]

]

}

I just saw this 8 days later after amethyst crashed so I'll check it out when I wake up and get back to you

That's really dumb. Geez.

Yeah, wanted to make a highlight for a web page and I can't tell how to do it.

*sighs*

At this, point... Do you expect any better.

No.

make your example try with lantern extension

Oof. That means nobody knows how to make them properly, except nostr:npub180cvv07tjdrrgpa0j7j7tmnyl2yr6yr7l8j4s3evf6u64th6gkwsyjh6w6 ?

I just copied from examples I saw in the wild when I made Lantern.

It's just the text of the highlight in the "content" field and the URL in the "r" tag. I also remove all query strings except in some rare cases where they're meaningful (hardcoded, it's basically YouTube).

The "textquotewhatever" stuff are Lantern-specific and not really necessary, but I keep them just because the code I inherited uses those as fallback and who am I to overrule them?

If I have to look at your code, to figure out what the spec describes, what is the spec for?

Whuuut?never read that spec before.

It's just content + link, are you kidding lololol 😹

So apps all have their own way of finding (and thus often defining in the JSON) the position?

I don't even know. 😂 The highlight json looks wildly different, depending upon which client produces it, and the spec is full of fiddly blah blah, but I just have content and an r-tag with a URL and it works everywhere.

Wish the spec contained a minimal example of an event highlighting a note and an event highlighting a web page.

Weird, to me, to make a spec defining a new kind, and leave out any examples.

That's so simple, that I handrolled it with my events publisher.

https://next-alexandria.gitcitadel.eu/events

This is probably why something so universally useful has had such slow takeup. Everyone like

Open spec.

Stare in confusion.

Look at published events.

Stare in confusion even harder.

Move on to next kind.

elsat created the issue in nostrability

https://github.com/nostrability/nostrability/issues/61

Lol, sure they all implement highlights.

Except that they all use some other JSON set up to define the position / context in the text.

I'll add Alexandria to his list.

I bet if I highlight the word "the" and only add a link, I break :90percent: of apps that display highlight in the text.

Totally feel you on that! 😂 The json can be a total mess depending on the client. Just gotta roll with what works, right? A minimal example would’ve been clutch for sure! It’s like, how you gonna define a new kind and not drop some examples? 🤦‍♂️