Giter VIP home page Giter VIP logo

litebrowser-linux's Introduction

What is litehtml?

litehtml is the lightweight HTML rendering engine with CSS2/CSS3 support. Note that litehtml itself does not draw any text, pictures or other graphics and that litehtml does not depend on any image/draw/font library. You are free to use any library to draw images, fonts and any other graphics. litehtml just parses HTML/CSS and places the HTML elements into the correct positions (renders HTML). To draw the HTML elements you have to implement the simple callback interface document_container. This interface is really simple, check it out! The document_container implementation is required to render HTML correctly.

Where litehtml can be used

litehtml can be used when you need to show HTML formatted text or even to create a mini-browser, but using it as a full-featured HTML engine is not recommended. Usually you don't need something like WebKit to show simple HTML tooltips or HTML-formatted text, litehtml is much better for these as it's more lightweight and easier to integrate into your application.

HTML Parser

litehtml uses the gumbo-parser to parse HTML. Gumbo is an implementation of the HTML5 parsing algorithm implemented as a pure C99 library with no outside dependencies. It's designed to serve as a building block for other tools and libraries such as linters, validators, templating languages, and refactoring and analysis tools.

Compatibility

litehtml is compatible with any platform supported by C++ and STL. For Windows MS Visual Studio 2013 is recommended. litehtml supports only UTF-8 strings.

Support for HTML and CSS standards

Unfortunately litehtml is not fully compatible with HTML/CSS standards. There is lots of work to do to make litehtml work as well as modern browsers. But litehtml supports most HTML tags and CSS properties. You can find the list of supported CSS properties in this table. For most simple usecases the HTML/CSS features supported by litehtml are enough. Right now litehtml supports even some pages with very complex HTML/CSS designs. As an example the pages created with bootstrap framework are usually well formatted by litehtml.

Testing litehtml

You can download the simple browser (litebrowser) to test the litehtml rendering engine.

The litebrowser source codes are available on GitHub:

License

litehtml is distributed under New BSD License. The gumbo-parser is disributed under Apache License, Version 2.0

Links

litebrowser-linux's People

Contributors

arnaudv6 avatar drizt avatar gr4yj3d1 avatar nerfur avatar noemurr avatar prantlf avatar stasoid avatar tordex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

litebrowser-linux's Issues

floating elements

first of all, congratulations for bringing this daunting html engine thing into a simple code that an ordinary developer can use, it is fast, lightweight and easy to understand. I found it better than webkit in many ways

I have stumble across an issue which i am not sure is due to litehtml's feature itself.

situation is;

i have many floating images left and right of a page and in between paragraph, can litehtml render correctly for all cases, i know floating elements are game spoiler of html but i would like to know whether i made any mistake or a full floating element implementation is something litehtml do not have at the moment.

Please find the render image, i am using png stream for viewing the results.
output

thanks much

./litehtml does not contain CMakeLists.txt

When I run cmake ~/litebrowser-linux/ I get this error:

CMake Error at CMakeLists.txt:27 (add_subdirectory):
  The source directory

    /home/kali/litebrowser-linux/litehtml

  does not contain a CMakeLists.txt file.

I'm not used to use cmake (./configure && make && make install often works just fine). So i don't know if I'm doing something wrong. How could I fix this?

Here would be the entire log of the output:
http://sprunge.us/hhME

gdkmm

Debian 12:

cmake ..
-- Package 'gdkmm-3.0', required by 'virtual:world', not found

litebrowser seems to ignore the spaces between words and draws it from beginning of the line

image

Git revision: master (cc098addadc4266d83b779442930e387327c6cc2)
Litehtml revision: v0.4-114-g1d4c939 (master(1d4c9391619c092fecb71227f4910f7a3757767c))
Operating System: Fedora 33 (x86_64)
Compiler: GCC 10.2.1 20201125 (Red Hat 10.2.1-9)

The HTML document is:

<!DOCTYPE html>
<html>
        <head>
                <meta charset="utf-8">
                <title>Vzhuh</title>
        </head>
        <body>
                <p>
                        meow meeeeeeeeeeow meeeeeeeeeow meow-meow
                </p>
        </body>
</html>

Unable to build on FreeBSD 14.0

I make it to this point. Thank you!

/usr/include/c++/v1/__utility/pair.h:74:5: error: the parameter for this explicitly-defaulted copy constructor is const, but a member or base requires it to be non-const
    pair(pair const&) = default;
    ^
/usr/include/c++/v1/map:739:16: note: in instantiation of template class 'std::pair<const std::string, cairo_surface_wrapper>' requested here
    value_type __cc_;
               ^
litebrowser-linux/litehtml/containers/cairo/cairo_images_cache.h:64:11: note: in instantiation of template class 'std::__value_type<std::string, cairo_surface_wrapper>' requested here
                if(iter != m_images.end())
                        ^
In file included from litebrowser-linux/src/main.cpp:1:
In file included from litebrowser-linux/src/globals.h:3:
In file included from /usr/include/c++/v1/fstream:186:
In file included from /usr/include/c++/v1/__locale:18:
In file included from /usr/include/c++/v1/mutex:191:
In file included from /usr/include/c++/v1/__memory/shared_ptr.h:31:
/usr/include/c++/v1/__memory/unique_ptr.h:65:5: warning: delete called on non-final 'litehtml::line_box_item' that has virtual functions but non-virtual destructor [-Wdelete-non-abstract-non-virtual-dtor]
    delete __ptr;
    ^
/usr/include/c++/v1/__memory/unique_ptr.h:297:7: note: in instantiation of member function 'std::default_delete<litehtml::line_box_item>::operator()' requested here
      __ptr_.second()(__tmp);
      ^
/usr/include/c++/v1/__memory/unique_ptr.h:263:75: note: in instantiation of member function 'std::unique_ptr<litehtml::line_box_item>::reset' requested here
  _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 ~unique_ptr() { reset(); }
                                                                          ^
/usr/include/c++/v1/__memory/allocator_traits.h:325:15: note: in instantiation of member function 'std::unique_ptr<litehtml::line_box_item>::~unique_ptr' requested here
        __p->~_Tp();
              ^
/usr/include/c++/v1/list:739:34: note: in instantiation of function template specialization 'std::allocator_traits<std::allocator<std::__list_node<std::unique_ptr<litehtml::line_box_item>, void *>>>::destroy<std::unique_ptr<litehtml::line_box_item>, void, void>' requested here
            __node_alloc_traits::destroy(__na, _VSTD::addressof(__np->__value_));
                                 ^
/usr/include/c++/v1/list:720:3: note: in instantiation of member function 'std::__list_imp<std::unique_ptr<litehtml::line_box_item>, std::allocator<std::unique_ptr<litehtml::line_box_item>>>::clear' requested here
  clear();
  ^
/usr/include/c++/v1/list:811:28: note: in instantiation of member function 'std::__list_imp<std::unique_ptr<litehtml::line_box_item>, std::allocator<std::unique_ptr<litehtml::line_box_item>>>::~__list_imp' requested here
class _LIBCPP_TEMPLATE_VIS list
                           ^
2 warnings and 1 error generated.
*** Error code 1

Stop.

We need a port to Gtk4

Gtk3 is now officially retired and the talk of starting the Gtk5 branch is getting more intense.
The Gtk4 port has significant changes if we want fast drawing.

Poco/URI.h: No such file or directory

I ran git clone --recursive https://github.com/litehtml/litebrowser-linux.git to clone this repository. I then ran cmake ./, and finally make.

On running make, around the 90% mark, I'm getting this error:

[ 87%] Building C object litehtml/CMakeFiles/litehtml.dir/src/gumbo/vector.c.o
Linking CXX static library liblitehtml.a
[ 87%] Built target litehtml
[ 88%] Generating src/master.css.inc
Scanning dependencies of target litebrowser
[ 90%] Building CXX object CMakeFiles/litebrowser.dir/src/main.cpp.o
In file included from /home/ekansh/Downloads/litebrowser-linux/src/main.cpp:1:0:
/home/ekansh/Downloads/litebrowser-linux/src/globals.h:26:22: fatal error: Poco/URI.h: No such file or directory
#include <Poco/URI.h>
^
compilation terminated.
make[2]: *** [CMakeFiles/litebrowser.dir/src/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/litebrowser.dir/all] Error 2
make: *** [all] Error 2

How should I proceed to fix this issue?

can't compile it on OpenBSD with README instructions

got errors:

[ 14%] Building CXX object litehtml/CMakeFiles/litehtml.dir/src/css_length.cpp.o                                                       
In file included from /home/nerfur/litebrowser-linux/litehtml/src/css_length.cpp:1:                                                    
In file included from /home/nerfur/litebrowser-linux/litehtml/include/litehtml/html.h:14:                                              
/home/nerfur/litebrowser-linux/litehtml/include/litehtml/types.h:228:15: error: definition of implicit copy constructor for 'typed_int'
 is deprecated because it has a user-provided copy assignment operator [-Werror,-Wdeprecated-copy-with-user-provided-copy]             
                        typed_int& operator=(const typed_int& v)                                         
In file included from /home/nerfur/litebrowser-linux/litehtml/src/css_length.cpp:1:
In file included from /home/nerfur/litebrowser-linux/litehtml/include/litehtml/html.h:5:
In file included from /usr/include/c++/v1/string:576:
In file included from /usr/include/c++/v1/string_view:1025:
In file included from /usr/include/c++/v1/algorithm:1747:
In file included from /usr/include/c++/v1/__algorithm/inplace_merge.h:28:
/usr/include/c++/v1/__memory/unique_ptr.h:65:5: error: delete called on non-final 'litehtml::line_box_item' that has virtual functions 
but non-virtual destructor [-Werror,-Wdelete-non-abstract-non-virtual-dtor]
    delete __ptr;
    ^

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.