upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/84.md
diff options
context:
space:
mode:
Diffstat (limited to '84.md')
-rw-r--r--84.md61
1 files changed, 0 insertions, 61 deletions
diff --git a/84.md b/84.md
index 89bf88b..4caab62 100644
--- a/84.md
+++ b/84.md
@@ -35,64 +35,3 @@ last value of the tag.
35### Context 35### Context
36Clients MAY include a `context` tag, useful when the highlight is a subset of a paragraph and displaying the 36Clients MAY include a `context` tag, useful when the highlight is a subset of a paragraph and displaying the
37surrounding content might be beneficial to give context to the higlight. 37surrounding content might be beneficial to give context to the higlight.
38
39### Ranges
40Clients MAY include `range` tags with the start/end indexes of where the highlight begins and finishes within
41the referenced article/tagged-event.
42
43```
44[ "range", <start-index>, <end-index> ]
45```
46
47Additionally a range with `context` as the third value of the tag MAY be added to indicate the begin/finish indexes
48of the highlight within the included `context` tag.
49
50```
51[ "range", <start-index>, <end-index>, "context" ]
52```
53
54#### Text-based nostr events' highlights
55
56Highlights of Nostr events SHOULD use the range index of the content as-is
57(e.g. NIP-23 articles include the markdown instead of computing the index from the rendered markdown).
58
59```
60[ "range", 3000, 3042 ] # highlight begins at index position 3000 of the tagged event's `.content`
61[ "range", 42, 84, "context" ] # highlight begins at index position 42 of the `context` tag's value
62```
63
64#### Non-text-based nostr events' highlights
65
66A `kind:9802` event that tags a NIP-94 event which includes a video or audio file can use ranges to
67indicate the start/end time position in seconds.
68
69#### Ranges in URL highlights
70
71When creating a highlight from a URL the range should be expressed over
72the extracted plain text of the formatted content (e.g. rendered HTML instead of including the HTML markup);
73this helps make finding the correct indexes easier on websites with markup variations on each render.
74
75e.g. `<html><body>hello, world</body></html>`
76
77Tagging `hello, world` would result in using a range tag like `["range", 0, 12 ]`.
78
79Text extraction (i.e. translation from non-plain text medium like HTML or PDF) is highly subjective and the value
80of the range should be carefully interpreted by the different clients that support this.
81
82```json
83{
84 "created_at": 1682707885,
85 "content": "while allowing creators to simply keep doing what they’re doing. Creators don’t need to be blatant shills for brands",
86 "tags": [
87 [ "r", "https://footstr.com/zapvertise/" ],
88 [ "p", "c48e29f04b482cc01ca1f9ef8c86ef8318c059e0e9353235162f080f26e14c11", "wss://relay.url", "author" ],
89 [ "context", "The Nostr zapvertising model creates a truly free market for advertisers, while allowing creators to simply keep doing what they’re doing. Creators don’t need to be blatant shills for brands, they just have to create high quality content people find valuable, and companies will naturally want to zapvertise on their posts." ]
90 [ "range", 3916, 4032 ],
91 [ "range", 74, 190, "context" ],
92 ],
93 "kind": 9802,
94 "pubkey": "fa984bd7dbb282f07e16e7ae87b26a2a7b9b90b7246a44771f0cf5ae58018f52",
95 "id": "59e5887a3cdf32d5f11edf9b8cd098c620d278514b2edde3e6d1ba8a541d262c",
96 "sig": "f2d15b8bc2csf6d198350f8df0a31dcf66d7c32ec9c54e6b3f102d579370b7de9d164d70350a5b32a2911db3b124e972bafa9a1bc8fd60c1e338903d2f6306b0"
97}
98```