image

the sleepy snake

index :: path :: html_relpath

html_relpath(pathfrom, pathto, ignorecase=True)

Constructs a html style relative path and returns it.

pathfrom: the the directory to point from
pathto: the path (file or directory) to point to

If ignorecase if False, the function handles the comparisons case sensitive.

sample:

pathto = 'somewhere\\up\\mysite.html'
pathfrom = 'somewhere/else'
print html_relpath(pathto, pathfrom)
>> '../up/mysite.html'