View Single Post
Old 01-03-2025, 09:07 AM   #565
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,841
Karma: 6120478
Join Date: Nov 2009
Device: many
A bookpath is a path from the root folder of the epub to that particular file. To link in css from any one xhtml file you need to calculate the relative path from the folder holding the xhtml file to your css file so you can create the proper link. There are a number of utility routines available to python plugins on Sigil to help you do that.

From the Sigil plugin interface code see bookcontainer.py:

Code:
    # returns the href relative path from source bookpath to target bookpath
    def get_relativepath(self, from_bookpath, to_bookpath):
        return self._w.get_relativepath(from_bookpath, to_bookpath)
There are also routines required to uuencode and uudecode path elements properly and many other things.
KevinH is offline   Reply With Quote