[dev] Whether a css selector applies to given html surf code

From: Sagar Acharya <sagaracharya_AT_tutanota.com>
Date: Mon, 25 Oct 2021 20:36:31 +0200 (CEST)


I'm making this software called kamitkami. It's a python script which takes 2 inputs foo.html and bar.css and outputs a css file named bar_foo.css which contains only the css which applies to the particular html page . This will make css extremely minimal and page loading faster.

This code is incomplete yet and I need someone help from surf developers. I have the css selectors in a python list, corresponding blocks in another list. I also have the html as a string. I think surf must detect whether a particular css selector applies to an html string or not. If someone can help me on how to do it (what code applies?), or contribute to kamitkami on the link below, I'd be grateful.

I'm thinking along the lines of submitting list and html as input to some subpart of compiled surf code with os module of python and getting back a list of only css selector which applies.
Thanking you
Sagar Acharya
https://notabug.org/sagaracharya/kamitka <https://notabug.org/sagaracharya/kamitkami>mi

P.S. Notabug is facing DoS attacks. You may have to check after some time if it doesn't show up.
Received on Mon Oct 25 2021 - 20:36:31 CEST

This archive was generated by hypermail 2.3.0 : Mon Oct 25 2021 - 20:48:07 CEST