Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In javascript docset if...else page not opening #1009

Open
GoodGuyNick opened this issue Oct 10, 2018 · 16 comments
Open

In javascript docset if...else page not opening #1009

GoodGuyNick opened this issue Oct 10, 2018 · 16 comments

Comments

@GoodGuyNick
Copy link

Ubuntu 18.04.1, Zeal 0.6.0

Can't open page for if...else in javascript docset.

@GoodGuyNick GoodGuyNick changed the title in javascript docset if...else page not opening In javascript docset if...else page not opening Oct 10, 2018
@GoodGuyNick
Copy link
Author

GoodGuyNick commented Oct 12, 2018

The same goes for anything that has ... in the name.

@nishanthkarthik
Copy link
Contributor

nishanthkarthik commented Oct 12, 2018

@GoodGuyNick Very similar to my comment on #1010 , you have to rename JavaScript.docset/Contents/Resources/Documents/developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/statements to Statements.

If my workaround works for you, you can close this issue since both are technically same.

Edit: It worked for me after the rename

@nishanthkarthik
Copy link
Contributor

For similar problems, you can right click -> copy link and put it in a browser to see if it's valid. If not, there is probably a case mismatch somewhere. Please let me know if it works for you.

Tagging @Kapeli here too (since the folder is different in this case)

@Kapeli
Copy link
Contributor

Kapeli commented Oct 12, 2018

@trollixx Could Zeal be changed to be case insensitive?

@nishanthkarthik
Copy link
Contributor

@Kapeli The links are simple browser openable file:// links and they are handled with case sensitivity on firefox Linux too.

@auscompgeek
Copy link

@Kapeli It's not that Zeal is case-sensitive, but rather that filesystems are case-sensitive. Not really anything Zeal would be able to fix, short of changing how docsets are stored.

@Kapeli
Copy link
Contributor

Kapeli commented Oct 12, 2018

Dash is case insensitive (even on iOS, which has a case sensitive file system). The websites I clone are mostly case insensitive (i.e. http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements and http://developer.mozilla.org/en-us/docs/web/javascript/reference/statements are the same.

As MDN is a Wiki, it contains links of varying cases and my cloner will create the directory structure using the casing it encounters first during traversal.

Renaming stuff fixes things on one end, but breaks them on another.

Zeal becoming case insensitive is the easiest fix.

Parsing the docsets and sanitizing the links so this doesn't happen is the harder fix, but I'd be lying if I said I'd ever do that (I can't allocate a significant amount of time for something that doesn't affect Dash).

@nishanthkarthik
Copy link
Contributor

@Kapeli Do you have a syscall that does case insensitive lookups on OSX? How do you open a document without traversing the file tree? How would your parser decide between two files in a docset, Int.java and int.java?

@Kapeli
Copy link
Contributor

Kapeli commented Oct 12, 2018

@Kapeli Do you have a syscall that does case insensitive lookups on OSX? How do you open a document without traversing the file tree?

Dash stores docsets in an archived format, so to load a file it looks up the index of the file within the archive.

Zeal can either build an index of all files within the docset and do a case insensitive look up on that index when it needs a file, or it can use the same index Dash uses. The index location/format is:

wget https://kapeli.com/feeds/JavaScript.tgz.tarix -O JavaScript.tarix.tgz && tar -xzf JavaScript.tarix.tgz && sqlite3 JavaScript.tgz.tarix "SELECT * FROM tarindex LIMIT 100"

There might be other ways to do this as well.

How would your parser decide between two files in a docset, Int.java and int.java?

Int.java and int.java (as files) won't normally exist in a docset, because docsets are generated on a case insensitive system. However, if that were to happen I'd just show the file that the link requests. Do a case sensitive lookup first and fallback to case insensitive only on failure.

@GoodGuyNick
Copy link
Author

If my workaround works for you, you can close this issue since both are technically same.

@nishanthkarthik Thank you for workaround. Now everything works. I think this issue should be closed when discussion about it will end. Or not?

@nishanthkarthik
Copy link
Contributor

@GoodGuyNick let's keep it open. We'll probably come up with a permanent fix

@trollixx
Copy link
Member

I guess it's time to implement #138...

@carestad
Copy link

I have only experienced this with the JS docset, and only for stuff under the Statements reference for now, so my solution was to just symlink statements to Statements. But this is of course re-set every time the docset is updated, which can be a bit annoying.

cd ~/.local/share/Zeal/Zeal/docsets/JavaScript.docset/Contents/Resources/Documents/developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/
ln -s statements Statements

@vvch
Copy link

vvch commented Jul 9, 2020

Not only 'Statements' folder, but also 'Global_Objects', 'Operators' and may be others. Seems like there may be many such folders

@TCB13
Copy link

TCB13 commented Dec 14, 2020

All javascript docs seems to be broken as of now:

Screenshot 2020-12-14 151619

Same with HTML:

Screenshot 2020-12-14 151738

Maybe this is an issue with Mozilla Docs?

v 0.6.1

@trollixx
Copy link
Member

@TCB13 Different issue, see #1155.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

8 participants