Code Monkey home page Code Monkey logo

Comments (4)

tordex avatar tordex commented on May 18, 2024
  1. am I right in thinking that gumbo is only used for html parsing, and this lib leverages it by in turn taking care of css (computing rendering positions/size/clipping/etc.)?

Yes, gumbo is used to parse html only. CSS are parsed by litehtml itself.

  1. would you think it would be feasible to adapt the library to use something like BeautifulSoup/JSoup for the html parsing instead of gumbo?

Hmm... this is interesting. I guess this is not a big problem. It is simple to build elements tree from other parser. I'll add this into todo-list 👍

  1. would you mind if I (try to) port the lib to another language (obviously crediting you and including your license)?

I'll be glad to see ports to another languages.

from litehtml.

azrafe7 avatar azrafe7 commented on May 18, 2024

Great! 👍
And nice to hear it sounds interesting to you too.

from litehtml.

azrafe7 avatar azrafe7 commented on May 18, 2024

And please post here if you make any progress in that direction.

from litehtml.

azrafe7 avatar azrafe7 commented on May 18, 2024

Hi there, and sorry for bumping this up. Just a couple more questions/observations (which really are feature requests :D).

  • I can't stress enough how much I like the render-agnostic property of this lib, so what I'd hope for is to have two more interfaces (like litehtml::document_container): one for handling html (say parseHtml(string)), and one for parsing/applying css (say computeStyle(style, doc))
  • I get it could be cumbersome to do (as this may also need an intermediate representation), but I still think that separating the processes could make things easier to work with (and also make it possible to switch libraries for the specific needs)

I know I'm speaking out of my direct needs/hopes, but do these requests seem sensible to you and addressable in the nearest future?

PS: maybe this needs to be a separate issue?!
PPS: main reason for asking this is that there are only a few libs out there (in the opensource zone), that return layout props from css, although many offer to parse html and/or css (with no layout). So mixing&matching them might be very interesting (if only for benchmarking purposes and a common task).

Thanks.

from litehtml.

Related Issues (20)

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.