pebbe / tree-sitter-gemtext

Gemtext grammar for Tree-sitter
0 stars 0 forks source link

i've already made a gemtext tree-sitter grammar a few weeks back :) #1

Open nbsp opened 11 months ago

nbsp commented 11 months ago

hello! just wanted to point you in the direction of my tree-sitter-gemini repository, which as far as i can tell is feature complete, and used in the Helix editor. https://git.sr.ht/~sfr/tree-sitter-gemini i think it would be best if we consolidated our efforts and tried to work on this together in case it isn't finished after all!

pebbe commented 11 months ago

I have compared our two versions. There are some interesting differences.

You covered some things I missed:

I covered some things you don't:

I think the grammar should be named gemtext, not gemini. Gemini is the protocol, gemtext is the file format. Vim/nvim also use the name gemtext.

I don't know how to continue. I have more questions:

nbsp commented 11 months ago

You parse tags at the beginning of code blocks. I don't, though I do allow for extra text. Is this part of the specification?

it is! clients MAY parse that as alt text.

I require a space after a header marker, making lines that start with #### not a header.

i followed the gemini protocol closely to see what tags need a space after them and what don't. it's inconsistent, but i followed the specification to a T.

I think the grammar should be named gemtext, not gemini. Gemini is the protocol, gemtext is the file format.

that is largely incorrect. the colloqueal name for the file format is gemtext, yes, but it's not specified anywhere in any of the official specification. the canonical file format is text/gemini, so in my opinion the name is gemini text, not gemtext.

i'll have a look at the rest of your notes later :)