w3m icon indicating copy to clipboard operation
w3m copied to clipboard

Add Gemini support

Open rkta opened this issue 2 years ago • 15 comments

I'd like w3m to support the Gemini protocol0.

I already wrote a patch1 to add it.

This issue is mostly to make others aware and get some feedback if this is useful for them.

@tats, would you be willing to add this feature?

rkta avatar Mar 22 '23 06:03 rkta

@tats gemini is a protocol that embodies one of the major pillars of the engineer's philosophy: "Small is beautiful". Like w3m, it is extremely valuable because of its ability to greatly reduce data and bandwidth usage, making it light enough to be used on things like mobile computers running on dry batteries.

This is from Drew DeVault, creator of sway, aerc, sr.ht, scdoc, etc. https://drewdevault.com/2020/11/01/What-is-Gemini-anyway.html

To me, w3m itself is in a way like www to gopher/gemini, and with this patch, w3m can use www, gemini, and gopher, a similar protocol already supported by w3m, without switching, so gopher /gemini fans will be very comfortable. Even the latest version of lynx/links/elinks does not achieve that.

Please consider merging the patches in a positive manner. If there are any barriers, I will help you to solve them.

tkna91 avatar Mar 22 '23 11:03 tkna91

It would be great, though, if a patch could render not only links but also the basic tags, like blockquotes and headings.

Random example URL: gemini://idiomdrottning.org/moving-the-macguffin

097115 avatar Mar 22 '23 14:03 097115

What are the chances of Gemini evolving and the maintenance required for this? Is it stable?

it is extremely valuable because of its ability to greatly reduce data

Will it ever land compression? I'd be curious if it's actually lighter than a Brotli-compressed HTML file written in a simple style.

toastal avatar Mar 22 '23 14:03 toastal

On Wed, Mar 22, 2023 at 07:06:25AM -0700, 097115 wrote:

It would be great, though, if a patch could render not only links but also the basic tags, like blockquotes and headings.

Headings is already on my TODO list, see the linked blog post.

With blockquotes you mean preformatted mode, I guess. Besides not breaking long lines, I don't see anything special to do in a text-mode browser. How to deal with long lines in preformatted mode will be added as an option.

rkta avatar Mar 22 '23 14:03 rkta

@toastal Sorry, what I wrote was not a good explanation. Mainly the following seem to be Gemini's selling points

  • Relatively safe to use because it is difficult to track users and abuse
  • Small specifications and easy to develop.
  • Does not let the writer define the design. Design is defined by the reader and the client
  • Data is slim

For more information, please refer to the following. https://gemini.circumlunar.space/docs/faq.gmi

tkna91 avatar Mar 22 '23 14:03 tkna91

On Wed, Mar 22, 2023 at 07:08:56AM -0700, toastal wrote:

What are the chances of Gemini evolving and the maintenance required for this? Is it stable?

The last update to the specs was over a year a ago. Given that the whole project is less then four years old I'd call this pretty stable. And keeping the spec simple was a design goal of Gemini.

it is extremely valuable because of its ability to greatly reduce data

Will it ever land compression? I'd be curious if it's actually lighter than a Brotli-compressed HTML file written in a simple style.

I doubt that it will ever get compression, see my comment above. But is difficult to make predictions, especially about the future. ;)

rkta avatar Mar 22 '23 14:03 rkta

@rkta

With blockquotes you mean preformatted mode, I guess.

No, I -- or, actually, Gemini itself -- mean the actual blockquotes, which are represented by the leading > (and are similar to the HTML's <blockquote> tag). They are also sort of on your TODO list, but without implementing all these basic things, the Gemini pages aren't really readable (see the sample link in my first comment above, for instance).

097115 avatar Mar 22 '23 15:03 097115

On Wed, Mar 22, 2023 at 08:31:26AM -0700, 097115 wrote:

@rkta

With blockquotes you mean preformatted mode, I guess.

No, I -- or, actually, Gemini itself -- mean the actual blockquotes, which are represented by the leading > (and are similar to the HTML's <blockquote> tag). They are also sort of on your TODO list, but without implementing all these basic things, the Gemini pages aren't really readable (see the sample link in my first comment above, for instance).

I see, we are talking about Quote lines. Yes, this (and all other line types mentioned in the spec) will be addressed before I submit a patch set upstream.

Just to be clear: The linked patch is an early version. I did the minimum to do what I need. That's why this is an issue - not a PR.

rkta avatar Mar 22 '23 18:03 rkta

I see, we are talking about Quote lines

Except they are called exactly blockquotes in the documentation but whatever :)

Thanks for your comment and for the roadmap nonetheless :)

097115 avatar Mar 22 '23 18:03 097115

On Wed, Mar 22, 2023 at 11:34:18AM -0700, 097115 wrote:

I see, we are talking about Quote lines

Except they are called exactly blockquotes in the documentation but whatever :)

You triggered the nerd in me. ;)

I found docs talking about blockquotes - but to quote

https://gemini.circumlunar.space/docs/specification.gmi

| 5.5.3 Quote lines

Let's say we both were right :)

Thanks for your comment and for the roadmap nonetheless :)

You are welcome! And thanks for the feedback - it helps to know that people care.

rkta avatar Mar 22 '23 18:03 rkta

| 5.5.3 Quote lines

...Which is because they are specifically talking about the line-oriented structure in this part -- and call links "link lines", headings "heading lines", etc. But somehow we don't really use that terminology, do we? :)

097115 avatar Mar 22 '23 18:03 097115

On Wed, Mar 22, 2023 at 11:51:47AM -0700, 097115 wrote:

| 5.5.3 Quote lines

...Which is because they are specifically talking about the line-oriented structure in this part -- and call links "link lines", headings "heading lines", etc. But somehow we don't really use that terminology, do we? :)

Well... But anyways, let's stop spamming people. If we ever meet in person I'll get you a beer and we can discuss this in more detail. ;)

rkta avatar Mar 22 '23 19:03 rkta

One more vote for this. Nice to see my 23 year old "Toyota Corolla" also support gemini.

Just my 2 cents as a proficient user of w3m, but not a programmer.

I have extensevely tested and used many gemini clients. I have already compiled and tested rkta w3m fork with gemin support. Works flawlessly. Thank you for your work.

Another excellent option very confortable for w3m users, who want to try gemini is "telescope". Awesome work by Omar Polo, https://telescope.omarpolo.com, https://github.com/omar-polo/telescope

m040601 avatar Mar 23 '23 01:03 m040601

On Wed, Mar 22, 2023 at 07:06:25AM -0700, 097115 wrote:

It would be great, though, if a patch could render not only links but also the basic tags, like blockquotes and headings.

Random example URL: gemini://idiomdrottning.org/moving-the-macguffin

I updated the patch to indent blockquotes with 4 spaces (same as with HTML blockquotes).

rkta avatar Mar 26 '23 16:03 rkta

@rkta

Looks nice, thanks :)

097115 avatar Mar 26 '23 17:03 097115