lexbor icon indicating copy to clipboard operation
lexbor copied to clipboard

Apply CSS and get properties

Open marcpabst opened this issue 4 years ago • 10 comments

Hey, I just stumbled upon this library and while it looks super neat, the examples are a bit sparse. So this might be a bit of a stretch, but I'm basically looking to do the following:

(1) Parse some HTML, (2) parse some CSS, (3) apply the CSS rules to the HTML tree, and (4) obtain style properties for each element.

Is this possible with lexbor at this point?

marcpabst avatar Sep 24 '21 08:09 marcpabst

Hi @marcpabst

(3) apply the CSS rules to the HTML tree, and (4) obtain style properties for each element.

On development stage. In a week, the parser of CSS properties will be ready and apply them to the nodes of the HTML tree.

lexborisov avatar Sep 24 '21 08:09 lexborisov

Nice! I will keep an eye on this package! Thanks!

marcpabst avatar Sep 24 '21 09:09 marcpabst

@marcpabst

Delays for at least a week. A lot of things to do at the main job.

lexborisov avatar Sep 30 '21 17:09 lexborisov

Hey, no worries - your real job is more important. Would be cool though if you'd let me know when there is any progress :).

marcpabst avatar Oct 06 '21 12:10 marcpabst

i'll try to help with css properties once css parser is in git

vtorri avatar Oct 06 '21 16:10 vtorri

Yeah, that'd be much appreciated!

marcpabst avatar Oct 09 '21 13:10 marcpabst

@lexborisov still no news on this ?

vtorri avatar Oct 19 '21 07:10 vtorri

Seems so. @vtorri

I am looking for a good HTML/CSS parser combo and so far Lexbor is the furthest next to Netsurf's codebase. Hopefuly it's gonna get this feature soon =)

IngwiePhoenix avatar Jan 27 '22 11:01 IngwiePhoenix

@IngwiePhoenix

There should be a big commit soon. Sorry, very busy with main job.

lexborisov avatar Jan 27 '22 12:01 lexborisov

@lexborisov Hello, I hope you are well. Is there progress with CSS work ?

vtorri avatar Mar 09 '22 07:03 vtorri

@marcpabst @vtorri @IngwiePhoenix

The first version of the styles has finally appeared. Better late than never!

Please, see examples.

Now I am expanding the available properties for parsing. At the moment, parsing recognizes only two properties: width and height. All other properties are treated as customs. They also apply to elements. Plus I will add more examples.

lexborisov avatar Jan 27 '23 09:01 lexborisov

@lexborisov great news !

vtorri avatar Jan 27 '23 10:01 vtorri

Thats awesome! :D Going to take a look at it right away.

IngwiePhoenix avatar Jan 27 '23 12:01 IngwiePhoenix

Took a look and I love what I see. This is pretty awesome, gonna play with this later. But this is pretty much what I needed. Great work, thanks so much!

IngwiePhoenix avatar Jan 27 '23 15:01 IngwiePhoenix

@IngwiePhoenix

Thanks for the feedback. This is just the beginning :)

lexborisov avatar Jan 27 '23 15:01 lexborisov

@lexborisov do you want me to help about css properties ?

vtorri avatar Jan 27 '23 20:01 vtorri

@vtorri

You can not ask, but immediately help! :) In fact, I will now add the main (needed for further development) properties. And I will describe the steps for adding new properties.

lexborisov avatar Jan 28 '23 07:01 lexborisov

@vtorri

Please, see wiki instructions for add new property for parsing.

Later I will write a list of properties that can be dealt with.

lexborisov avatar Jan 28 '23 17:01 lexborisov

@marcpabst

Done.

lexborisov avatar Jun 12 '23 20:06 lexborisov