nips icon indicating copy to clipboard operation
nips copied to clipboard

nip54: change to asciidoc

Open fiatjaf opened this issue 1 year ago • 10 comments

== Why?

Because Markdown is somewhat of a mess. It's fine when you just use the core features, but when you start to add tables and other stuff it quickly degrades. And there had been talks already of how to add description lists, footnotes, sidebars and tables to these wiki articles so we would not be able to stick to mostly plain text anyway.

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.

Read this if you're still not convinced: https://docs.asciidoctor.org/asciidoc/latest/asciidoc-vs-markdown/

Caveat: I don't have much experience with Asciidoc (if I had I might have proposed this NIP with Asciidoc since the beginning anyway).

Caveat: unfortunately Asciidoc is extensible, so it is not guaranteed that implementations will all implement the same extensions and stay compatible forever. However the extensions at least are well-delimited, named and specified and must be added explicitly by the developer (unlike on Markdown world where each library will add ad-hoc extensions by themselves), so that should be less bad. Also it's always clear when an extension is being used since its usage is delimited in tagged blocks in the source text. In any case I think we won't need any extensions for a long time.

== Migration path

Option 1:: Just drop Markdown support and be done with it. Everything will still be readable. Option 2:: Documents created up to the date this document is merged should still be supported in the existing wiki clients. Documents with a higher timestamp shouldn't. Clients can drop Markdown support entirely in the future when that becomes a more reasonable idea.

@hzrd149 @pablof7z @SilberWitch

fiatjaf avatar Jun 10 '24 11:06 fiatjaf

@vitorpamplona has also added support for 30818.

pablof7z avatar Jun 10 '24 11:06 pablof7z

Clients will end up having to support every format anyway, so bring it on.

vitorpamplona avatar Jun 10 '24 11:06 vitorpamplona

I like asciidoc better. But what about this: https://wikifreedia.xyz/nud:-nostext/npub1jlrs53pkdfjnts29kveljul2sm0actt6n8dxrrzqcersttvcuv3qdjynqn

staab avatar Jun 10 '24 15:06 staab

Clients will end up having to support every format anyway, so bring it on.

I knew you were going to say this, but let me just say again that you are wrong!

fiatjaf avatar Jun 10 '24 16:06 fiatjaf

I like asciidoc better. But what about this: wikifreedia.xyz/nud:-nostext/npub1jlrs53pkdfjnts29kveljul2sm0actt6n8dxrrzqcersttvcuv3qdjynqn

Looks like a simpler and more strict Markdown. Could be good for notes, but it's not powerful enough for wiki articles.

fiatjaf avatar Jun 10 '24 16:06 fiatjaf

I knew you were going to say this, but let me just say again that you are wrong!

Prove me wrong and everybody wins.

vitorpamplona avatar Jun 10 '24 16:06 vitorpamplona

Looks like a simpler and more strict Markdown. Could be good for notes, but it's not powerful enough for wiki articles.

Yeah, I'd go nuts trying to format articles with so few options. Like trying to edit a magazine or encyclopedia with nothing but .txt files.

Silberengel avatar Jun 11 '24 19:06 Silberengel

Interesting. I'm apparently using some asciidoc formatting, thinking it was markdown, like italics . That explains why some of the clients aren't displaying them as expected.

I've seen the ==Header format in the articles I've referenced from Medium.com, so they seem to be using Asciidoc.

I support this change. 🤔 It's still early and markdown files stay readable, even without the rendering.

Silberengel avatar Jun 11 '24 19:06 Silberengel

Interesting. I'm apparently using some asciidoc formatting, thinking it was markdown, like italics . That explains why some of the clients aren't displaying them as expected.

I've seen the ==Header format in the articles I've referenced from Medium.com, so they seem to be using Asciidoc.

I support this change. 🤔 It's still early and markdown files stay readable, even without the rendering.

Apparently, GitHub allows for both, as the italics rendering is correct.

Silberengel avatar Jun 11 '24 19:06 Silberengel

Is this going to happen?

Silberengel avatar Jul 10 '24 04:07 Silberengel

Yes!

fiatjaf avatar Jul 10 '24 11:07 fiatjaf

https://wikistr.com/ has transitioned already and I'm slowly working on the change for Wikifreedia.

fiatjaf avatar Jul 10 '24 11:07 fiatjaf

Okay, I saw that my files looked funny on wikistr. Now I'm sort of trapped, since some of them have changed, but some not, so I guess I'll just wait until everyone moves and then reformat.

Silberengel avatar Jul 13 '24 06:07 Silberengel

@hzrd149 are you also aware of this change?

Silberengel avatar Jul 13 '24 06:07 Silberengel

@hzrd149 are you also aware of this change?

I saw this a month ago and looked into it little. It looks like a good format, but I'm worried there isn't enough libraries for clients to use for rendering. I also wasn't able to find any WYSIWYG editors for it, so most clients might have to implement thier own

I'm not opposed to this change, but I think there is a benefit to markdown even though it is a bit messy and missing features

hzrd149 avatar Jul 13 '24 07:07 hzrd149

Yeah, it's a bit of a hurdle.

Silberengel avatar Jul 13 '24 07:07 Silberengel

We've added an optional "markup" tag to our 30041, so that someone can define if they used asciidoc, markdown, LaTeX, PlantUML, AsciiMath or whatnot in their article event, with markdown the default, if it's undefined.

We have to support a wider array because we're using the events for complex documents like scientific research papers and etc.

Might be an option for other article events. 🤷‍♀️

Silberengel avatar Jul 13 '24 07:07 Silberengel

We've added an optional "markup" tag to our 30041, so that someone can define if they used asciidoc, markdown, LaTeX, PlantUML, AsciiMath or whatnot in their article event, with markdown the default, if it's undefined.

We have to support a wider array because we're using the events for complex documents like scientific research papers and etc.

Might be an option for other article events. 🤷‍♀️

Different formats should have different kinds; otherwise you just raise the bar to support a specific kind and increase the complexity for rendering it. Overloading kinds with different, even if adjacent, meanings and/or renderings is an anti-pattern.

pablof7z avatar Jul 13 '24 08:07 pablof7z

Then we should reject this PR and stick with only markdown and come up with a different kind for Asciidoc.

Silberengel avatar Jul 13 '24 10:07 Silberengel

We are basing our Kind 30041 off of this one and we assumed that allowed for markdown default.

Silberengel avatar Jul 13 '24 11:07 Silberengel

I believe without Asciidoc (or some other markup language, suggestions accepted) the Nostr free encyclopedia will never attract the methodical people who love categories and structure. Markdown is too limited and clients will naturally start adding ad-hoc extensions to it to accommodate some needs, and these extensions will not be as complete as Asciidoc, but also they won't be standard enough and there won't be WYSIWG editors that support them uniformly anyway, so nothing will work and it will be chaos. @hzrd149

If I manage to finish my Quill integration then we'll have at least one WYSIWG editor for Asciidoc.

fiatjaf avatar Jul 13 '24 14:07 fiatjaf

Is NIP-23 also going to Asciidoc or staying Markdown?

Silberengel avatar Jul 13 '24 14:07 Silberengel

That should stay in Markdown.

fiatjaf avatar Jul 13 '24 14:07 fiatjaf

I am currently working in a WYSIWG editor for nostr based on tiptap / prosemirror, It supports markdown already and I would love to support Asciidoc too, and I agree this should be in a different kind.

cesardeazevedo avatar Jul 16 '24 04:07 cesardeazevedo

Can we just have two different wiki kinds, one for markdown and one for asciidoc? Then the writer is free to pick the one they prefer.

It will usually be markdown, but some more complex documents could use asciidoc.

Silberengel avatar Jul 16 '24 15:07 Silberengel

No. It must be one. Having two just doubles the work for everybody. We're still very early here and we can transition. But if everybody wants to remain on Markdown then please let me know so I can stop working on Asciidoc crap.

fiatjaf avatar Jul 16 '24 15:07 fiatjaf

I don't see how we don't offer some event with asciidoc, long-term, without cutting off advanced publishing use cases. We were considering having asciidoc-blocks in markdown docs, but it seems to be easier, the other way around.

I also saw that there are PlantUML and LaTeX extensions for Asciidoc, which is awesome.

Silberengel avatar Jul 16 '24 16:07 Silberengel

Yeah, okay, just looked at my wiki pages under Asciidoc and they look nearly the same. Only the more advanced stuff that only I'm using is even different.

Most people could keep writing markdown and wouldn't even notice the difference.

Silberengel avatar Jul 16 '24 16:07 Silberengel

https://github.com/fiatjaf/quill-asciidoc @hzrd149 https://github.com/fiatjaf/svelte-asciidoc https://github.com/pablof7z/wiki/pull/32

fiatjaf avatar Jul 21 '24 22:07 fiatjaf

Okay, GitCitadel is going to host Wikistr, we're rewriting our docs into asciidoc, and our products will use @fiatjaf 's asciidoc libraries. Done.

Silberengel avatar Jul 22 '24 08:07 Silberengel