Home » Community » Coffee corner » HTML viewer
|
Re: HTML viewer [message #60021 is a reply to message #60020] |
Mon, 10 July 2023 22:29   |
 |
Klugier
Messages: 1099 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello Luigi,
The true thing is that HTML view control is one of the most important think we need at the moment. Please noticed that sometime ago Zbych implemented ChromiumBrowser. Currently, it is available only in upp/archieve repository, not UppHub. It is basing on CEF (Chromium Embedded Framework), Personally, I would do not go for lite-browser, because the whole library looks like a niche for me with poor support. It means that security norms will not be meet, which are crucial in context of applications that renders HTML and executes JavaScript.
If, we look for our competitors such as QT, the have QTWebEngine that is basing on CEF. We should aim for similar thing.
Since the implementation is not trivial and the maintenance cost will be high. Providing this functionality for U++ is a challenge not for one person, but for a group of people. So, before starting working on that it would be good if you will find somebody that will help you! 
Klugier
U++ - one framework to rule them all.
|
|
|
Re: HTML viewer [message #60025 is a reply to message #60021] |
Tue, 11 July 2023 11:57   |
 |
mirek
Messages: 14257 Registered: November 2005
|
Ultimate Member |
|
|
Klugier wrote on Mon, 10 July 2023 22:29Hello Luigi,
The true thing is that HTML view control is one of the most important think we need at the moment. Please noticed that sometime ago Zbych implemented ChromiumBrowser. Currently, it is available only in upp/archieve repository, not UppHub. It is basing on CEF (Chromium Embedded Framework), Personally, I would do not go for lite-browser, because the whole library looks like a niche for me with poor support. It means that security norms will not be meet, which are crucial in context of applications that renders HTML and executes JavaScript.
If, we look for our competitors such as QT, the have QTWebEngine that is basing on CEF. We should aim for similar thing.
Since the implementation is not trivial and the maintenance cost will be high. Providing this functionality for U++ is a challenge not for one person, but for a group of people. So, before starting working on that it would be good if you will find somebody that will help you! 
Klugier
Accidentally, I was forced to implement limited support for RichEdit accepting HTML clipboard format.
While definitely not the same thing as HTML viewer, it now understand most of style formatting that is applicable to RichText. I plan to enrich it a bit more (to actually understand CSS, add support for tables and maybe some sort of support for importing images).
https://github.com/ultimatepp/ultimatepp/blob/master/uppsrc/ RichText/ParseHTML.cpp
(That is not meant to distract us from CEF, ParseHTML is not even meant to be complete HTML viewer, just a bridge that allows some HTML->RichText/QTF conversion)
Mirek
|
|
|
|
Re: HTML viewer [message #60028 is a reply to message #60027] |
Tue, 11 July 2023 13:14   |
 |
mirek
Messages: 14257 Registered: November 2005
|
Ultimate Member |
|
|
Oblivion wrote on Tue, 11 July 2023 12:37Hi,
In case you've missed it, we already have a fully functional html-5 parser (and sanitizer/prettifier as a bonus) now.
(Of course, I am aware that Mirek's code serves another purpose, but a fully-fledged HTML->QTF converter, using HtmlTools package would too be very easy to implement.)
Humor me 
I have actually noticed this, but "It corrects and cleans up HTML and XML documents by fixing markup errors and upgrading legacy code to modern standards." does not seem like going too far into rendering stuff.
Parsing HTML is (relatively) easy. Where it gets hard IMO is where you have to interpret styles to have some meaningful rendering info. Font sizes, colors, line styles and width and such.. I have not checked too deeply, but few examples I have seen do not seem to deal with that stuff at all...
Mirek
|
|
|
Re: HTML viewer [message #60029 is a reply to message #60025] |
Tue, 11 July 2023 13:21   |
 |
forlano
Messages: 1207 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
mirek wrote on Tue, 11 July 2023 11:57
Accidentally, I was forced to implement limited support for RichEdit accepting HTML clipboard format.
While definitely not the same thing as HTML viewer, it now understand most of style formatting that is applicable to RichText. I plan to enrich it a bit more (to actually understand CSS, add support for tables and maybe some sort of support for importing images).
https://github.com/ultimatepp/ultimatepp/blob/master/uppsrc/ RichText/ParseHTML.cpp
(That is not meant to distract us from CEF, ParseHTML is not even meant to be complete HTML viewer, just a bridge that allows some HTML->RichText/QTF conversion)
Mirek
Hi Mirek,
even this may help a lot.
Is there an example package that shows how to use it or it should work as paste operation from clipboard?
Thanks,
Luigi
[Updated on: Tue, 11 July 2023 13:28] Report message to a moderator
|
|
|
Re: HTML viewer [message #60030 is a reply to message #60027] |
Tue, 11 July 2023 13:26   |
 |
forlano
Messages: 1207 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
Oblivion wrote on Tue, 11 July 2023 12:37Hi,
In case you've missed it, we already have a fully functional html-5 parser (and sanitizer/prettifier as a bonus) now.
(Of course, I am aware that Mirek's code serves another purpose, but a fully-fledged HTML->QTF converter, using HtmlTools package would too be very easy to implement.)
Best regards,
Oblivion
Yes, I missed it.
I downloaded the code and extracted HtmlTools and HtmlToolsExample package in MyApps folder, but theide (16879) doesn't list them
Do I need to do something else before to compile them?
Thanks,
Luigi
|
|
|
Re: HTML viewer [message #60031 is a reply to message #60029] |
Tue, 11 July 2023 13:38   |
 |
mirek
Messages: 14257 Registered: November 2005
|
Ultimate Member |
|
|
forlano wrote on Tue, 11 July 2023 13:21mirek wrote on Tue, 11 July 2023 11:57
Accidentally, I was forced to implement limited support for RichEdit accepting HTML clipboard format.
While definitely not the same thing as HTML viewer, it now understand most of style formatting that is applicable to RichText. I plan to enrich it a bit more (to actually understand CSS, add support for tables and maybe some sort of support for importing images).
https://github.com/ultimatepp/ultimatepp/blob/master/uppsrc/ RichText/ParseHTML.cpp
(That is not meant to distract us from CEF, ParseHTML is not even meant to be complete HTML viewer, just a bridge that allows some HTML->RichText/QTF conversion)
Mirek
Hi Mirek,
even this may help a lot.
Is there an example package that shows how to use it or it should work as paste operation from clipboard?
Thanks,
Luigi
Right now it works as paste. But you can use it in the code as well, look for TrivialHtmlParse (really simple, String and base font on input, RichText as return value...)
|
|
|
Re: HTML viewer [message #60033 is a reply to message #60030] |
Tue, 11 July 2023 13:45   |
Oblivion
Messages: 1206 Registered: August 2007
|
Senior Contributor |
|
|
Hello Luigi
Quote:Yes, I missed it.
I downloaded the code and extracted HtmlTools and HtmlToolsExample package in MyApps folder, but theide (16879) doesn't list them Rolling Eyes
Do I need to do something else before to compile them?
The package is a UppHub package, it is in UppHub. You can'tsee the HtmlTools package in default view because it is not a "main pacakge". (choose non-main packages
And no, you don't need to do anything else to compile it. It "should" compile fine on Windows and Linux systems. The wrapped libtidy is statically linked; it's source is not huge, and I've also enabled Upp's allocators. (You can disable them if you like)
Best regards,
Oblivion
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[Updated on: Tue, 11 July 2023 14:16] Report message to a moderator
|
|
|
Re: HTML viewer [message #60034 is a reply to message #60028] |
Tue, 11 July 2023 13:52   |
Oblivion
Messages: 1206 Registered: August 2007
|
Senior Contributor |
|
|
Quote:Parsing HTML is (relatively) easy. Where it gets hard IMO is where you have to interpret styles to have some meaningful rendering info. Font sizes, colors, line styles and width and such.. I have not checked too deeply, but few examples I have seen do not seem to deal with that stuff at all...
Of course, you are right. It is not meant to build a web renderer and it does not parse CSS. But it let's you focus on everything else (i.e. in this case parsing CSS, without worrying too much about even colossal HTML pages.). And I can tell you from my experience with libtidy that it makes life so much easier if you are working with web pages. The parser part itself is very fast and is long battle-tested (after all, it is one of the "eldest" parsers).
Best regards,
Oblivion
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[Updated on: Tue, 11 July 2023 13:53] Report message to a moderator
|
|
|
Re: HTML viewer [message #60158 is a reply to message #60021] |
Sat, 16 September 2023 20:30  |
Oblivion
Messages: 1206 Registered: August 2007
|
Senior Contributor |
|
|
Quote:Hello Luigi,
The true thing is that HTML view control is one of the most important think we need at the moment. Please noticed that sometime ago Zbych implemented ChromiumBrowser. Currently, it is available only in upp/archieve repository, not UppHub. It is basing on CEF (Chromium Embedded Framework), Personally, I would do not go for lite-browser, because the whole library looks like a niche for me with poor support. It means that security norms will not be meet, which are crucial in context of applications that renders HTML and executes JavaScript.
If, we look for our competitors such as QT, the have QTWebEngine that is basing on CEF. We should aim for similar thing.
Since the implementation is not trivial and the maintenance cost will be high. Providing this functionality for U++ is a challenge not for one person, but for a group of people. So, before starting working on that it would be good if you will find somebody that will help you! Smile
Klugier
I think Servo is going to be a good alternative to chromium: https://servo.org/
Only downside is that it is in rust
Best regards,
Oblivion
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[Updated on: Sat, 16 September 2023 20:34] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sun May 11 14:47:31 CEST 2025
Total time taken to generate the page: 0.00892 seconds
|