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 8 forks source link

URL Problems using `livemark build` on Windows #205

Closed gabrielbdornas closed 2 years ago

gabrielbdornas commented 2 years ago

Overview

I'm trying to build a simple livemark static site with a colleague and we're experiencing a very interesting problem due to operational systems differences, I believe.

I'm using Linux ubuntu 20.04 and he's using Windows 10.

When I run livemark start or livemark build on my ubuntu everything goes well, but when he does the same on windows it builds weird URLs. It appears that "/" is been changing to "%5C", as you can see here.

The Github source code could be found here.

I also tried to run livemark build --help and see if there were some options related to windows construction and also to search for something in the documentation.

roll commented 2 years ago

Thanks @gabrielbdornas for flagging! I'll investigate

roll commented 2 years ago

Hi @aivuk, can you please take a look?

We need to debug the livemark build call to figure out the root case on Windows

aivuk commented 2 years ago

Hi @gabrielbdornas, I finally got a window 10 machine and checked out the repository, run your build.sh script and the html were correct generated, without the "%5C". Maybe the problem is related with some old library used by livemark that is fixed by now? I build the website with:

aivuk commented 2 years ago

@roll just pointed me that maybe the problem is how I'm using Python, I used after installing the Ubuntu application for window https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windows-10#1-overview How are you using Python in the windows machine?

aivuk commented 2 years ago

Ok @roll, found out the problem and created a pull request. The problem is that outside Windows Services for Linux, as the Ubuntu app that I used in Windows, the os.path do not return POSIX compliant paths, they use backslash if it's running in windows. I changed the get_relpathto aways return a POSIX path with this slash \ instead of windows backslash /.