Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move renderer to WebKitGtk #66

Closed
tfuxu opened this issue Mar 24, 2023 · 3 comments
Closed

Move renderer to WebKitGtk #66

tfuxu opened this issue Mar 24, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@tfuxu
Copy link
Contributor

tfuxu commented Mar 24, 2023

Description

The current solution of using TextView for rendering Gemini documents is quite ingenious I must say, but it also limits things that can be done in Geopard. For example images can't be rendered in normal TextView and long text in preformatted mode makes whole webview horizontally longer (which could be resolved in WebKit by adding a frame to preformatted text with horizontal scrollbar).

WebKitGtk has a broad range of functions and classes which allow for complete customization to make it as integrated in Gtk apps as possible. WebKit has built-in TLS certificates support (access to website's TLS information available in this function) which would resolve issue #19. It has find controller for implementing text search in WebView (possibly resolves #42). There is also an extensive Settings class which allows to modify or disable almost every feature of WebKit.

For possible implementation, Dev Toolbox and Apostrophe uses WebViewGtk for rendering Markdown preview. For Dev Toolbox implementation, you can look here, and here on how it converts Markdown to HTML. For Apostrophe, you can look here and here.

@tfuxu tfuxu added the enhancement New feature or request label Mar 24, 2023
@ranfdev
Copy link
Owner

ranfdev commented Mar 24, 2023

I know WebKit is more powerful, but it's also more resource intensive.

We are using gemini to stay away from the bloat brought up by the web. I feel WebKit goes against the gemini values.
I'm trying my best to make a lightweight and fast browser that doesn't rely on web technologies.

I won't use WebKit sorry. Thanks anyway for proposing an improvement.

@ranfdev ranfdev closed this as completed Mar 24, 2023
@tfuxu
Copy link
Contributor Author

tfuxu commented Mar 25, 2023

Yea, I agree. WebKit would be a overkill for a Gemini browser and a big bloat, because of many features which will never be used in any Gemini website. It can also get more memory intensive than Firefox when many tabs are opened simultaneously (~600MB with 7 tabs of Markdown document converted to HTML).

However, I found an alternative which you might like. GemView is a Gemtext (and not only) GTK 4 renderer written in Rust. It's the same approach as a current Geopard renderer, because it uses an inherited Gtk.TextView widget to render Gemini, Gopher, Finger and Spartan pages. Here's a full feature list.

@ranfdev
Copy link
Owner

ranfdev commented Mar 25, 2023

That's great, thanks for linking it.

I will look and learn from that project, but I'm not going to use it directly.

I'm going forward on another path. I plan on replacing the TextView with a SourceView, like the one used inside the gnome builder IDE.

SourceView extends the TextView by adding search/replace, highlighting, and other useful stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants