frictionlessdata / livemark

Data presentation framework for Python that generates static sites from extended Markdown with interactive charts, tables, scripts, and other features
https://livemark.frictionlessdata.io
MIT License
95 stars 9 forks source link

aways use posix paths on generated relative paths in html #206

Closed aivuk closed 2 years ago

aivuk commented 2 years ago

With livemark is used in Windows, outside a POSIX compliant system the generated URLs inside the generated HTML will have Window back slashes (\folder\file instead of /folder/file). This happens because of how gel_relapath is generating the path using os.path.join. os.path always follows the format of the current OS, this means, if you are in windows it is going to use back slashes. The problem happens that urls follow POSIX path, with this slash /.

I don't know if there are other places that we need to change the paths to POSIX ones. If we just change everywhere that os.path is used, this will causes problems for windows user when livemark need to open a file somewhere.

aivuk commented 2 years ago

@roll I added get_url_repath and changed some places to use it, but I still haven't tested on windows. Not all places that I changed I'm sure if we need a POSIX path or the local OS one. I will test in few minutes (as soon as my Ubuntu finish upgrading and I can reboot my machine!).

aivuk commented 2 years ago

@roll tested the branch in windows, generated the website at https://github.com/Andrelamor/erros-validacao and it worked.