Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 01-12-2020, 08:26 PM   #1
Jianhao
Junior Member
Jianhao began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jan 2020
Device: Kindle
How does live CSS really work in Python?

Dear Ppl:
I am attempting to be a calibre developer
I really wonder how calibre does to get corresponding css by clicking one point in html editor.
my questions are as follows:
1. how you match corresponding css given certain element node in the element tree? some selector match engine? like tinycss2 library?
2. (most important one
how does calibre do to get a element node by just simply clicking one line in html editor, how does it iterate the tree to get its element node by just clicking?

Any hints or tips will be soo appreciated!
Best regards.
Jianhao is offline   Reply With Quote
Old 01-12-2020, 08:55 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
It doesn't do it in python it does it javascript using QWebEngine, see live_css.py and live_css.pyj
kovidgoyal is offline   Reply With Quote
Advert
Reply

Tags
calibre, css, developement, html, python


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Live CSS oddity Phssthpok Editor 6 01-10-2020 10:51 AM
Getting Python to work with Sigil JollyRoger Sigil 2 08-26-2016 02:04 AM
Oddity with Live CSS BobC Editor 3 06-15-2014 06:22 AM
Live CSS questions DrChiper Editor 23 05-26-2014 10:33 AM
why doesn't this CSS work? Barty Conversion 1 02-09-2011 09:28 PM


All times are GMT -4. The time now is 03:20 PM.


MobileRead.com is a privately owned, operated and funded community.