AvaloniaUI / Avalonia.HtmlRenderer

Avalonia front-end for the HtmlRenderer project.
MIT License
137 stars 34 forks source link

HtmlPanel control #4

Closed aplocher closed 1 year ago

aplocher commented 5 years ago

In HtmlControl.cs there is a large comment referencing HtmlLabel and HtmlPanel. There doesn't appear to be an HtmlPanel, in fact the only public class with a public constructor appears to be HtmlLabel. Is there any way to render chunk of HTML in a panel with Avalonia?

I'm looking for a cross platform equivalent to the System.Windows.(Controls|Forms).WebBrowser control - preferably one that doesn't require a Chrome process to be loaded up (which I believe is how CefGlue works, if I'm not mistaken). Avoiding the Chrome process was my primary reason for choosing Avalonia over Electron for my project.

Thanks! :)

PS - are there any implementation examples/demos or documentation for this that I can reference? thx again

PS Again - when I say "WebBrowser" equivalent I should clarify that it doesn't need to be used for anything complex. I'm essentially rendering Markdown to HTML using Markdig. So it will be some headers, bold, italic, links, etc. No crazy layout or anything.

kekekeks commented 5 years ago

I think HtmlPanel wasn't ported from WPF version for some reason. Should be possible to do.

are there any implementation examples/demos or documentation for this that I can reference? thx again

There was a demo in our old control catalog before HtmlRenderer was moved to a separate repo, can't find it now.

Unfortunately our HtmlRenderer port wasn't well-maintained since 2015, I think. We might need a rewrite of the adapters since they have quite a bit of stuff hardcoded due to the lack of the needed APIs at that point.

apavelm commented 4 years ago

Hi, I didn't find an appropriate section/sub-project and probably this topic matches most. Using an internal in-app browser is a big pain for WPF, especially for cross-platform applications. I don't consider "WebBrowser" as an in-app browser because of it outdated and doesn't support/visualize HTML/CSS/JS good. For example, a simple case with external OAuth2 auth via "Auth0" service. Usage of something like CEF will increase the size of the app up to 160MB or more, or even more. Also, it is platform and architecture-specific. No special additional features required, just correct visualization of HTML with CSS/JS to show Auth0 login page.

@kekekeks Nikita, could you please advice something for this purpose to be used among with Avalonia? I would very much appreciate if you could help with this. Thank you.

kekekeks commented 4 years ago

With "don't ship 160MB of an actual browser" requirement you probably want something like WebWindow library that attempts to reuse existing platform webview capabilities. Which means only supporting Windows 10 as the minimum Windows version and depending on GTK on Linux.

apavelm commented 4 years ago

Unfortunately, WebWindow is unworkable at all. Even their "Hello World" sample doesn't work. re 160MB I told about CEF. WebWindow looks interesting, but...

Anyway, thank you for the link

maxkatz6 commented 1 year ago

Done