upleb.uk

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

summaryrefslogtreecommitdiff
path: root/54.md
diff options
context:
space:
mode:
Diffstat (limited to '54.md')
-rw-r--r--54.md144
1 files changed, 91 insertions, 53 deletions
diff --git a/54.md b/54.md
index 3a02150..ead362d 100644
--- a/54.md
+++ b/54.md
@@ -8,57 +8,115 @@ Wiki
8 8
9This NIP defines `kind:30818` (an _addressable event_) for descriptions (or encyclopedia entries) of particular subjects, and it's expected that multiple people will write articles about the exact same subjects, with either small variations or completely independent content. 9This NIP defines `kind:30818` (an _addressable event_) for descriptions (or encyclopedia entries) of particular subjects, and it's expected that multiple people will write articles about the exact same subjects, with either small variations or completely independent content.
10 10
11Articles are identified by lowercase, normalized ascii `d` tags. 11Articles are identified by lowercase, normalized `d` tags.
12 12
13### Articles 13## Articles
14```json 14```json
15{ 15{
16 "content": "A wiki is a hypertext publication collaboratively edited and managed by its own audience.", 16 "content": "A wiki is a hypertext publication collaboratively edited and managed by its own audience.",
17 "tags": [ 17 "tags": [
18 ["d", "wiki"], 18 ["d", "wiki"],
19 ["title", "Wiki"], 19 ["title", "Wiki"]
20 ] 20 ]
21} 21}
22``` 22```
23 23
24### `d` tag normalization rules 24## `d` tag normalization rules
25 25
26- Any non-letter character MUST be converted to a `-`. 26- All letters with uppercase/lowercase variants MUST be converted to lowercase.
27- All letters MUST be converted to lowercase. 27- Whitespace MUST be converted to `-`.
28- Punctuation and symbols SHOULD be removed.
29- Multiple consecutive `-` SHOULD be collapsed to a single `-`.
30- Leading and trailing `-` SHOULD be removed.
31- Non-ASCII letters (e.g., Japanese, Chinese, Arabic, Cyrillic) MUST be preserved as UTF-8.
32- Numbers MUST be preserved.
28 33
29### Content 34For example:
35- `"Wiki Article"` → `"wiki-article"`
36- `"What's Up?"` → `"whats-up"`
37- `" Hello World "` → `"hello-world"`
38- `"Article 1"` → `"article-1"`
39- `"ウィキペディア"` → `"ウィキペディア"` (Japanese, no case change)
40- `"Ñoño"` → `"ñoño"` (Spanish, lowercased)
41- `"Москва"` → `"москва"` (Russian, lowercased)
42- `"日本語 Article"` → `"日本語-article"` (mixed scripts)
30 43
31The `content` should be Asciidoc with two extra functionalities: **wikilinks** and **nostr:...** links. 44## Content
32 45
33Unlike normal Asciidoc links `http://example.com[]` that link to external webpages, wikilinks `[[]]` link to other articles in the wiki. In this case, the wiki is the entirety of Nostr. Clicking on a wikilink should cause the client to ask relays for events with `d` tags equal to the target of that wikilink. 46The `content` should be [Djot](https://djot.net/) with two special functionalities:
34 47
35Wikilinks can take these two forms: 481. Links can have target URIs in [NIP-21](21.md) format, like `[Bob](nostr:npub1...)`.
492. When a reference can't be found for a reference-style link, it should link to the wiki article with that name instead (wikilink behavior). The target is normalized following the `d` tag normalization rules above.
36 50
37 1. `[[Target Page]]` -- in this case it will link to the page `target-page` (according to `d` tag normalization rules above) and be displayed as `Target Page`; 51For example:
38 2. `[[target page|see this]]` -- in this case it will link to the page `target-page`, but will be displayed as `see this`.
39 52
40`nostr:...` links, as per [NIP-21](21.md), should link to profiles or arbitrary Nostr events. Although it is not recommended to link to specific versions of articles -- instead the _wikilink_ syntax should be preferred, since it should be left to the reader and their client to decide what version of any given article they want to read. 53```djot
54Bitcoin is a [cryptocurrency][] invented by [Satoshi Nakamoto][].
41 55
42### Optional extra tags 56See also: [proof of work][] and [lightning network][Lightning Network].
57
58[Satoshi Nakamoto]: nostr:npub1satoshi...
59```
60
61In the article above:
62- `[cryptocurrency][]` links to the wiki article with `d` tag `"cryptocurrency"` (no reference defined, so it becomes a wikilink)
63- `[Satoshi Nakamoto][]` links to the npub (reference is defined)
64- `[proof of work][]` links to the article with `d` tag `"proof-of-work"`
65- `[lightning network][Lightning Network]` links to `"lightning-network"`, displays as "lightning network"
66
67Wikilinks also work with non-Latin scripts following the same normalization rules:
68- `[ビットコイン][]` → links to article with `d` tag `"ビットコイン"`
69- `[Japanese Article][日本語 記事]` → links to `"日本語-記事"`, displays as "Japanese Article"
70- `[Биткойн][]` → links to article with `d` tag `"биткойн"` (Cyrillic, lowercased)
71
72[NIP-21](21.md) `nostr:` links can also be used to link to profiles or arbitrary Nostr events. It is not recommended to link to specific versions of articles — the wikilink syntax should be preferred instead, since it should be left to the reader and their client to decide what version of any given article they want to read.
73
74## Optional extra tags
43 75
44 - `title`: for when the display title should be different from the `d` tag. 76 - `title`: for when the display title should be different from the `d` tag.
45 - `summary`: for display in lists. 77 - `summary`: for display in lists.
46 - `a` and `e`: for referencing the original event a wiki article was forked from. 78 - `a` and `e`: for referencing the original event a wiki article was forked from.
47 79
48### Merge Requests 80## Merge Requests
49 81
50Event `kind:818` represents a request to merge from a forked article into the source. It is directed to a pubkey and references the original article and the modified event. 82Event `kind:818` represents a request to merge from a forked article into the source. It is directed to a pubkey and references the original article and the modified event.
51 83
52[INSERT EVENT EXAMPLE] 84```json
85{
86 "content": "I added information about the block size limit",
87 "kind": 818,
88 "tags": [
89 ["a", "30818:<destination-pubkey>:bitcoin", "<relay-url>"],
90 ["e", "<version-against-which-the-modification-was-made>", "<relay-url>"],
91 ["p", "<destination-pubkey>"],
92 ["e", "<version-to-be-merged>", "<relay-url>", "source"]
93 ]
94}
95```
53 96
54### Redirects 97- `.content`: an optional explanation detailing why this merge is being requested.
98- `a` tag: tag of the article which should be modified (i.e. the target of this merge request).
99- `e` tag: optional version of the article on which this modification is based.
100- `e` tag with `source` marker: the ID of the event that should be merged. This event id MUST be of a `kind:30818` as defined in this NIP.
55 101
56Event `kind:30819` is also defined to stand for "wiki redirects", i.e. if one thinks `Shell structure` should redirect to `Thin-shell structure` they can issue one of these events instead of replicating the content. These events can be used for automatically redirecting between articles on a client, but also for generating crowdsourced "disambiguation" pages ([common in Wikipedia](https://en.wikipedia.org/wiki/Help:Disambiguation)). 102The destination pubkey can create [NIP-25](25.md) reactions that tag the `kind:818` event with `+` or `-` to accept or reject the merge request.
57 103
58[INSERT EVENT EXAMPLE] 104## Redirects
59 105
60How to decide what article to display 106Event `kind:30819` is also defined to stand for "wiki redirects", i.e. if one thinks "BTC" should redirect to "Bitcoin" they can issue one of these events instead of replicating the content. These events can be used for automatically redirecting between articles on a client, but also for generating crowdsourced "disambiguation" pages ([common in Wikipedia](https://en.wikipedia.org/wiki/Help:Disambiguation)).
61------------------------------------- 107
108```json
109{
110 "kind": 30819,
111 "tags": [
112 ["d", "btc"],
113 ["a", "30818:<pubkey>:bitcoin", "<relay-url>"]
114 ],
115 "content": ""
116}
117```
118
119## How to decide what article to display
62 120
63As there could be many articles for each given name, some kind of prioritization must be done by clients. Criteria for this should vary between users and clients, but some means that can be used are described below: 121As there could be many articles for each given name, some kind of prioritization must be done by clients. Criteria for this should vary between users and clients, but some means that can be used are described below:
64 122
@@ -78,44 +136,24 @@ As there could be many articles for each given name, some kind of prioritization
78 136
79[NIP-51](51.md) lists can also be used to create a list of users that are trusted only in the context of wiki authorship or wiki curationship. 137[NIP-51](51.md) lists can also be used to create a list of users that are trusted only in the context of wiki authorship or wiki curationship.
80 138
81Forks 139## Forks
82--------- 140
83Wiki-events can tag other wiki-events with a `fork` marker to specify that this event came from a different version. Both `a` and `e` tags SHOULD be used and have the `fork` marker applied, to identify the exact version it was forked from. 141Wiki-events can tag other wiki-events with a `fork` marker to specify that this event came from a different version. Both `a` and `e` tags SHOULD be used and have the `fork` marker applied, to identify the exact version it was forked from.
84 142
85Deference 143## Deference
86--------- 144
87Wiki-events can tag other wiki-events with a `defer` marker to indicate that it considers someone else's entry as a "better" version of itself. If using a `defer` marker both `a` and `e` tags SHOULD be used. 145Wiki-events can tag other wiki-events with a `defer` marker to indicate that it considers someone else's entry as a "better" version of itself. If using a `defer` marker both `a` and `e` tags SHOULD be used.
88 146
89This is a stronger signal of trust than a `+` reaction. 147This is a stronger signal of trust than a `+` reaction.
90 148
91This marker is useful when a user edits someone else's entry; if the original author includes the editor's changes and the editor doesn't want to keep/maintain an independent version, the `link` tag could effectively be a considered a "deletion" of the editor's version and putting that pubkey's WoT weight behind the original author's version. 149This marker is useful when a user edits someone else's entry; if the original author includes the editor's changes and the editor doesn't want to keep/maintain an independent version, the `defer` tag could effectively be considered a "deletion" of the editor's version and putting that pubkey's WoT weight behind the original author's version.
92
93Why Asciidoc?
94-------------
95
96Wikitext is [garbage](nostr:nevent1qqsqt0gcggry60n72uglhuhypdlmr2dm6swjj69jex5v530gcpazlzsprpmhxue69uhhyetvv9ujumn0wdmksetjv5hxxmmdqy28wumn8ghj7un9d3shjtnyv9kh2uewd9hsygpm7rrrljungc6q0tuh5hj7ue863q73qlheu4vywtzwhx42a7j9n5ueneex) and Markdown is not powerful enough (besides being too freeform and unspecified and prone to generate incompatibilities in the future).
97
98Asciidoc has a strict spec, multiple implementations in many languages, and support for features that are very much necessary in a wiki article, like _sidebars_, _tables_ (with rich markup inside cells), many levels of _headings_, _footnotes_, _superscript_ and _subscript_ markup and _description lists_. It is also arguably easier to read in its plaintext format than Markdown (and certainly much better than Wikitext).
99 150
100# Appendix 1: Merge requests 151## Why Djot?
101Users can request other users to get their entries merged into someone else's entry by creating a `kind:818` event.
102
103```json
104{
105 "content": "I added information about how to make hot ice-creams",
106 "kind": 818,
107 "tags": [
108 [ "a", "30818:<destination-pubkey>:hot-ice-creams", "<relay-url>" ],
109 [ "e", "<version-against-which-the-modification-was-made>", "<relay-url>" ],
110 [ "p", "<destination-pubkey>" ],
111 [ "e", "<version-to-be-merged>", "<relay-url>", "source" ]
112 ]
113}
114```
115 152
116`.content`: an optional explanation detailing why this merge is being requested. 153[Djot](https://djot.net/) is a markup language created by John MacFarlane (author of Pandoc and co-author of CommonMark). It was chosen for the following reasons:
117`a` tag: tag of the article which should be modified (i.e. the target of this merge request).
118`e` tag: optional version of the article in which this modifications is based
119`e` tag with `source` marker: the ID of the event that should be merged. This event id MUST be of a `kind:30818` as defined in this NIP.
120 154
121The destination-pubkey is the pubkey being requested to merge something into their article can create [[NIP-25]] reactions that tag the `kind:818` event with `+` or `-` 155- **Well-defined spec**: Unlike Markdown (many incompatible dialects) or Asciidoc (spec tied to Ruby implementation), Djot has a clear, standalone specification.
156- **Native implementations**: Available in JavaScript, Lua, Rust, Go, and other languages without transpilation.
157- **Rich features**: Supports superscript, subscript, footnotes, tables, definition lists, and math — features useful for encyclopedic content.
158- **Familiar syntax**: Similar to basic Markdown, making it easy to learn.
159- **Fast parsing**: Designed for efficient linear-time parsing.