View Single Post
Old 01-07-2021, 04:48 PM   #48
wrCisco
Connoisseur
wrCisco ought to be getting tired of karma fortunes by now.wrCisco ought to be getting tired of karma fortunes by now.wrCisco ought to be getting tired of karma fortunes by now.wrCisco ought to be getting tired of karma fortunes by now.wrCisco ought to be getting tired of karma fortunes by now.wrCisco ought to be getting tired of karma fortunes by now.wrCisco ought to be getting tired of karma fortunes by now.wrCisco ought to be getting tired of karma fortunes by now.wrCisco ought to be getting tired of karma fortunes by now.wrCisco ought to be getting tired of karma fortunes by now.wrCisco ought to be getting tired of karma fortunes by now.
 
Posts: 50
Karma: 605108
Join Date: Apr 2016
Device: none
I compiled and tried the new cli cssparser, it went almost all well and good with various pseudo-classes, pseudo-elements, at-rules, vendor-prefixed properties (these with warnings, since they are not part of the standard) and vendor-prefixed at-rules (@-o-keyframes and the likes... not likely to be used in an epub, I just had an old css for a web page with animations...).

I encountered two problems:
- it didn't recognized the "@import" rule at the beginning of the stylesheet, and it deleted the space between "import" and the subsequent "url(...);" when printing;
- (minor) it lost one level of indentation in the serialization of nested at rules, so this code
Code:
@media amzn-mobi {
  @media only screen and (max-width: 650px) {
    p:nth-of-type(2n+3)::first-letter {
      color: red;
    }
  }
  .aclass:not(.anotherclass), h1 + p > span:last-child {
    color: blue;
  }
}
became
Code:
@media amzn-mobi {
    @media only screen and (max-width: 650px) {
    p:nth-of-type(2n+3)::first-letter {
        color:red;
    }
}

.aclass:not(.anotherclass),h1 + p > span:last-child {
    color:blue;
}    
}
(it's just an example: I know this code doesn't work on mobi, and probably this feature of nested conditional group rules is not even part of the epub standard, since it's still a candidate recommendation for the w3c, but it has been supported by all major browser engines for many years now).

A heads up on the more recent version of the Sigil fork for the gumbo query integration (https://github.com/kevinhendricks/Sigil): I had to replace "#include <exception>" with "#include <stdexcept>" in Query/CParser.cpp in order to compile it on Linux.

As for the Sigil's python interface, I couldn't got it to work with a list of integers as argument for the "runInPython" method: I had to convert all the numbers to strings. Then, with a QStringList, it was easy enough... Is it expected? (Maybe I just got it all wrong with the QVariant conversions).
wrCisco is offline   Reply With Quote