diff options
Diffstat (limited to '54.md')
| -rw-r--r-- | 54.md | 28 |
1 files changed, 16 insertions, 12 deletions
| @@ -6,12 +6,12 @@ Wiki | |||
| 6 | 6 | ||
| 7 | `draft` `optional` | 7 | `draft` `optional` |
| 8 | 8 | ||
| 9 | This NIP defines `kind:30818` (an _addressable event_) for long-form text content similar to [NIP-23](23.md), but with one important difference: articles are meant to be 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. | 9 | This 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 | ||
| 11 | Articles are identified by lowercase, normalized ascii `d` tags. | 11 | Articles are identified by lowercase, normalized ascii `d` tags. |
| 12 | 12 | ||
| 13 | ### Articles | 13 | ### Articles |
| 14 | ```jsonc | 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": [ |
| @@ -26,21 +26,25 @@ Articles are identified by lowercase, normalized ascii `d` tags. | |||
| 26 | - Any non-letter character MUST be converted to a `-`. | 26 | - Any non-letter character MUST be converted to a `-`. |
| 27 | - All letters MUST be converted to lowercase. | 27 | - All letters MUST be converted to lowercase. |
| 28 | 28 | ||
| 29 | ### Content rules | 29 | ### Content |
| 30 | 30 | ||
| 31 | The content should be Asciidoc, following the same rules as of [NIP-23](23.md), although it takes some extra (optional) metadata tags: | 31 | The `content` should be Asciidoc with two extra functionalities: **wikilinks** and **nostr:...** links. |
| 32 | 32 | ||
| 33 | - `title`: for when the display title should be different from the `d` tag. | 33 | Unlike 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. |
| 34 | - `summary`: for display in lists. | ||
| 35 | - `a` and `e`: for referencing the original event a wiki article was forked from. | ||
| 36 | |||
| 37 | One extra functionality is added: **wikilinks**. Unlike normal Asciidoc links `[]()` that link to 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. | ||
| 38 | 34 | ||
| 39 | Wikilinks can take these two forms: | 35 | Wikilinks can take these two forms: |
| 40 | 36 | ||
| 41 | 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`; | 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`; |
| 42 | 2. `[[target page|see this]]` -- in this case it will link to the page `target-page`, but will be displayed as `see this`. | 38 | 2. `[[target page|see this]]` -- in this case it will link to the page `target-page`, but will be displayed as `see this`. |
| 43 | 39 | ||
| 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. | ||
| 41 | |||
| 42 | ### Optional extra tags | ||
| 43 | |||
| 44 | - `title`: for when the display title should be different from the `d` tag. | ||
| 45 | - `summary`: for display in lists. | ||
| 46 | - `a` and `e`: for referencing the original event a wiki article was forked from. | ||
| 47 | |||
| 44 | ### Merge Requests | 48 | ### Merge Requests |
| 45 | 49 | ||
| 46 | Event `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. | 50 | Event `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. |
| @@ -96,13 +100,13 @@ Asciidoc has a strict spec, multiple implementations in many languages, and supp | |||
| 96 | # Appendix 1: Merge requests | 100 | # Appendix 1: Merge requests |
| 97 | Users can request other users to get their entries merged into someone else's entry by creating a `kind:818` event. | 101 | Users can request other users to get their entries merged into someone else's entry by creating a `kind:818` event. |
| 98 | 102 | ||
| 99 | ```jsonc | 103 | ```json |
| 100 | { | 104 | { |
| 101 | "content": "I added information about how to make hot ice-creams", | 105 | "content": "I added information about how to make hot ice-creams", |
| 102 | "kind": 818, | 106 | "kind": 818, |
| 103 | "tags": [ | 107 | "tags": [ |
| 104 | [ "a", "30818:<destination-pubkey>:hot-ice-creams", "<relay-url>" ], | 108 | [ "a", "30818:<destination-pubkey>:hot-ice-creams", "<relay-url>" ], |
| 105 | [ "e", "<version-against-which-the-modification-was-made>", "<relay-url>' ], | 109 | [ "e", "<version-against-which-the-modification-was-made>", "<relay-url>" ], |
| 106 | [ "p", "<destination-pubkey>" ], | 110 | [ "p", "<destination-pubkey>" ], |
| 107 | [ "e", "<version-to-be-merged>", "<relay-url>", "source" ] | 111 | [ "e", "<version-to-be-merged>", "<relay-url>", "source" ] |
| 108 | ] | 112 | ] |
| @@ -114,4 +118,4 @@ Users can request other users to get their entries merged into someone else's en | |||
| 114 | `e` tag: optional version of the article in which this modifications is based | 118 | `e` tag: optional version of the article in which this modifications is based |
| 115 | `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. | 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. |
| 116 | 120 | ||
| 117 | The destination-pubkey (the pubkey being requested to merge something into their article can create [[NIP-25]] reactions that tag the `kind:818` event with `+` or `-` | 121 | The 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 `-` |