Code Monkey home page Code Monkey logo

Comments (16)

spyysalo avatar spyysalo commented on July 1, 2024

A quick search suggests that renaming may indeed be the only way to get these to work on Windows (e.g. http://stackoverflow.com/questions/3689137/error-git-checkout-index-unable-to-create-file).

We've so far kept the type labels and file basenames identical. I'm not sure if this property is used anywhere at the moment, but keeping it would have some benefits for autogenerating links to the documentation.

On balance, I think being able to check the repository out on Windows is more important. We could e.g. add a prefix like label- to the filenames to allow this. If we go with this, should this be added to all filenames (maintaining consistency), or just the ones that are problematic for Windows (minimizing the effect)?

from docs.

dan-zeman avatar dan-zeman commented on July 1, 2024

Well, if we knew this at the beginning, I would say that consistency rules, but now renaming everything would be a lot of work, wouldn't it?

from docs.

spyysalo avatar spyysalo commented on July 1, 2024

now renaming everything would be a lot of work, wouldn't it?

Maybe not all that much, as most links are auto-generated. I fairly recently renamed directories, e.g. en -> en-dep, and I seem to recall the manual bit was limited to the nicely formatted tables on the dependency type index pages.

I'm kind of sad to lose the fairly nice URLs we have at the moment, but unless Jekyll has some renaming support, I suppose that can't be avoided. (I'll have a bit more of a look.)

from docs.

dan-zeman avatar dan-zeman commented on July 1, 2024

I'm kind of sad to lose the fairly nice URLs we have at the moment

Hmm, that's one of the technical consequences I wasn't realizing. I think that it is a good reason to actually not prefer consistent naming and rather just rename the auxes to vaux, auxv, _aux or something. After all the stupid Microsoft constraint (bracket the phrase either way :-)) itself is far from consistent.

from docs.

dan-zeman avatar dan-zeman commented on July 1, 2024

I just wrote descriptions of NOUN and ADJ. The definitions contain links to other tags and I found it extremely useful that I can use the tag + ".html" as the URL. I can still edit and correct the links if we decide to rename all files consistently but I am gradually shifting my initial enthusiasm to the "minimal-impact" solution, i.e. renaming only aux files.

from docs.

spyysalo avatar spyysalo commented on July 1, 2024

70435c4 has part of one possible solution: we could move aux only (to _aux, say) and set up a redirect page at aux. With luck, Windows would leave the latter alone but allow editing of the former. This would preserve the property that filenames match labels.

What do you think?

(Note to self: remove redirtest.md once finished testing.)

from docs.

dan-zeman avatar dan-zeman commented on July 1, 2024

Yes, that could help with editing the file with the contents. (But I can also edit it online in the browser.) The redirecting file will still cause troubles because it has to be named aux.md and it is part of the repository. The file will not check out and Windows Git will believe that I deleted the file intentionally. It will try to include the deletion in every commit and if I forget to uncheck it, I will destroy the redirection on the server. I am also unsure what it will do to the status of the rest of the repository. I now pulled current content over the unclean directories from yesterday and git status claims that all the newly pulled changed files are changes to be committed, plus there are now unversioned files (redirtest.md among them).

Would GitHub allow some other redirection method, e.g. using .htaccess?
http://kb.mediatemple.net/questions/242/How+do+I+redirect+my+site+using+a+.htaccess+file%3F

from docs.

spyysalo avatar spyysalo commented on July 1, 2024

The file will not check out and Windows Git will believe that I deleted the file intentionally.

OK, that's a showstopper for this idea then. (I've deleted redirtest.md)

Would GitHub allow some other redirection method, e.g. using .htaccess?

A quick search suggests at least not .htaccess (see e.g. http://rawsyntax.com/blog/blogging-on-jekyll-url-redirects/). I'll try to look around some more.

from docs.

spyysalo avatar spyysalo commented on July 1, 2024

OK, I think I found a solution that should work: https://help.github.com/articles/redirects-on-github-pages

testing this now.

from docs.

dan-zeman avatar dan-zeman commented on July 1, 2024

Sounds promising :-)

from docs.

spyysalo avatar spyysalo commented on July 1, 2024

Tried in cd6aa8c to redirect /ud-dep/_aux to /ud-dep/aux (the inverse of what we need, as a test) and idx to index.html. Neither works for me.

I think this is a good solution if it can be made to work. I'll have limited time in the next few days but will come back to this as soon as I can. It would be much appreciated if you could try this out also!

from docs.

dan-zeman avatar dan-zeman commented on July 1, 2024

No joy here either :-( I even temporarily removed safe: true from _config.yml because it is said to block custom plugins. Also tried vaux instead of _aux, just in case the underscore behaves differently. And various path + extension combinations. To no avail. I wonder if the _config.yml file is read every time I modify a page or if we have to do something else to turn Jekyll redirects on.

from docs.

spyysalo avatar spyysalo commented on July 1, 2024

@dan-zeman : thanks again for moving this forward! There are multiple blocking issues, one of which was that safe: true does block the plugin, as you noted.

Another issue was that the redirect-from gem wasn't installed on the machine that was doing the Jekyll generation. When this project was first set up, GitHub was running an older version of Jekyll, which didn't support collections (a feature we needed). To generate the site on a recent version of Jekyll, I wrote a simple script to listen to GitHub commit notifications (https://github.com/spyysalo/jekyll-hook) and do a pull-Jekyll-push cycle to the gh-pages branch. The original issue is since fixed -- GitHub now runs a recent Jekyll (https://pages.github.com/versions/) -- but I haven't switched branches yet to avoid any possibility of confusion during this fairly intense period of development. Anyway, I'd forgotten to install the redirect-gem on the machine that does this; mea culpa.

With these issues fixed, recently generated versions of the site (e.g. 4842e13) do generate redirect docs, like this one https://github.com/UniversalDependencies/docs/blob/gh-pages/var-aux.html . That file will be deleted (just experimenting), so for reference, the contents:

  <!DOCTYPE html>
  <meta charset=utf-8>
  <title>Redirecting...</title>
  <link rel=canonical href="/ud-dep/aux.html">
  <meta http-equiv=refresh content="0; url=/ud-dep/aux.html">
  <h1>Redirecting...</h1>
  <a href="/ud-dep/aux.html">Click here if you are not redirected.</a>
  <script>location='/ud-dep/aux.html'</script>

Now, there's a further issue here: the generated redirect links is wrong. The site is at http://universaldependencies.github.io/docs/ so the target URL is http://universaldependencies.github.io/docs/ud-dep/aux.html, but the generator produces /ud-dep/aux.html, redirecting to http://universaldependencies.github.io/ud-dep/aux.html (no docs/), which is 404.

This appears related: jekyll/jekyll-redirect-from#15

Will keep looking.

from docs.

spyysalo avatar spyysalo commented on July 1, 2024

In 475ce2d, redirect working from http://universaldependencies.github.io/docs/ud-dep/redir-aux.html -> http://universaldependencies.github.io/docs/ud-dep/aux.html

from docs.

spyysalo avatar spyysalo commented on July 1, 2024

Working for http://universaldependencies.github.io/docs/ud-dep/aux.html in f1885d2 , successfully redirects to http://universaldependencies.github.io/docs/ud-dep/label-aux.html .

I'm not terribly happy with the label- affix for the filename, but don't have a better suggestions just now (_aux won't do, as jekyll ignores files beginning with underscore. aux_ might work though). @dan-zeman : any preference?

from docs.

spyysalo avatar spyysalo commented on July 1, 2024

Working with names prepended with _ in 7934d37 (e.g. aux.html -> aux_.html). Tentatively closing this issue, feel free to re-open if anything remains.

from docs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.