diff options
| author | Vitor Pamplona <vitor@vitorpamplona.com> | 2024-12-19 10:15:46 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-19 10:15:46 -0500 |
| commit | f7d97f3f40dc6677e6f996ffff431142ffe05810 (patch) | |
| tree | 2eaa8c8628cc9a4b05811ed3869e21221fd85307 /54.md | |
| parent | d5b77b6d7348061cd0f16adc35e4d02a3a0b7380 (diff) | |
| parent | 561059ff85c171b87a12b8381b724b4afc569a97 (diff) | |
Merge branch 'master' into draft-event
Diffstat (limited to '54.md')
| -rw-r--r-- | 54.md | 34 |
1 files changed, 19 insertions, 15 deletions
| @@ -6,12 +6,12 @@ Wiki | |||
| 6 | 6 | ||
| 7 | `draft` `optional` | 7 | `draft` `optional` |
| 8 | 8 | ||
| 9 | This NIP defines `kind:30818` (a _parameterized replaceable 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 Markdown, 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 Markdown 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. |
| @@ -86,23 +90,23 @@ This is a stronger signal of trust than a `+` reaction. | |||
| 86 | 90 | ||
| 87 | This 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. | 91 | This 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. |
| 88 | 92 | ||
| 89 | Why Markdown? | 93 | Why Asciidoc? |
| 90 | ------------- | 94 | ------------- |
| 91 | 95 | ||
| 92 | If the idea is to make a wiki then the most obvious text format to use is probably the mediawiki/wikitext format used by Wikipedia since it's widely deployed in all mediawiki installations and used for decades with great success. However, it turns out that format is very bloated and convoluted, has way too many features and probably because of that it doesn't have many alternative implementations out there, and the ones that exist are not complete and don't look very trustworthy. Also it is very much a centralized format that can probably be changed at the whims of the Wikipedia owners. | 96 | Wikitext is [garbage](nostr:nevent1qqsqt0gcggry60n72uglhuhypdlmr2dm6swjj69jex5v530gcpazlzsprpmhxue69uhhyetvv9ujumn0wdmksetjv5hxxmmdqy28wumn8ghj7un9d3shjtnyv9kh2uewd9hsygpm7rrrljungc6q0tuh5hj7ue863q73qlheu4vywtzwhx42a7j9n5ueneex) and Markdown is not powerful enough (besides being too freeform and unspecified and prone to generate incompatibilities in the future). |
| 93 | 97 | ||
| 94 | On the other hand, Markdown has proven to work well for small scale wikis and one of the biggest wikis in the planet (which is not very often thought of as a wiki), [StackOverflow](https://stackoverflow.com) and its child sites, and also one of the biggest "personal wiki" software, [Obsidian](https://obsidian.md/). Markdown can probably deliver 95% of the functionality of wikitext. When augmented with tables, diagram generators and MathJax (which are common extensions that exist in the wild and can be included in this NIP) that rate probably goes to 99%, and its simplicity is a huge benefit that can't be overlooked. Wikitext format can also be transpíled into Markdown using Pandoc. Given all that, I think it's a reasonable suspicion that mediawiki is not inherently better than Markdown, the success of Wikipedia probably cannot be predicated on the syntax language choice. | 98 | Asciidoc 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). |
| 95 | 99 | ||
| 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 `-` |