projectEndings / staticSearch

A codebase to support a pure JSON search engine requiring no backend for any XHTML5 document collection
https://endings.uvic.ca/staticSearch/docs/index.html
Mozilla Public License 2.0
50 stars 22 forks source link

Pointing to Filepath URIs on Windows #250

Closed ebeshero closed 1 year ago

ebeshero commented 2 years ago

@martindholmes @joeytakeda I'm replicating a problem that my students are seeing on Windows computers when they test staticSearch. Windows users can't build successfully, I'm pretty sure because of the native Windows filepaths that point \ and get in the way of XSLT reading a proper URI in the XSLT. I'm pretty sure we just need to find the URI, run a replace() function on it to replace \ with /, but I'm trying to find the best place to do that... Any suggestions?

martindholmes commented 2 years ago

@ebeshero We know it fails on Windows but neither of us has the expertise or access to Windows to work on it. It does run under WSL though.

ebeshero commented 2 years ago

@martindholmes Well, I'm tinkering on a Windows machine and stalling with WSL, but I know that just about every programming script has a way to convert Windows filepaths to Unix-style. I think this might be the solution if we plant it in build.xml for the Windows people: https://ant.apache.org/manual/Tasks/pathconvert.html

joeytakeda commented 2 years ago

Hi @ebeshero! It’s great to hear you’re using staticSearch in your class! I’ve had good success with using GitHub actions with this, but the repos that use it at the moment are private.

I think pathconvert would work too, probably in concert with passing the line.separator property as a parameter to the XSLT—I could try something out, but unfortunately don’t have a windows machine available to test. That said, we do have some other discussions about this in #33 , which outlines a few other considerations regarding special filenames.

ebeshero commented 2 years ago

Confirming that WSL2 works, and configuration kind of tricky (as we might expect). We'll write up a bit of documentation for it. (It will need that for DHers on Windows.)

Haven't tested pathconvert yet...

martindholmes commented 1 year ago

@ebeshero We've tested and merged @tgraham-antenna 's kind contribution which makes the build work on Windows, so next time you use this with students your life should be a little easier.