zeal icon indicating copy to clipboard operation
zeal copied to clipboard

In javascript docset if...else page not opening

Open GoodGuyNick opened this issue 6 years ago • 16 comments

Ubuntu 18.04.1, Zeal 0.6.0

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

GoodGuyNick avatar Oct 10 '18 14:10 GoodGuyNick

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

GoodGuyNick avatar Oct 12 '18 11:10 GoodGuyNick

@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 avatar Oct 12 '18 13:10 nishanthkarthik

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)

nishanthkarthik avatar Oct 12 '18 13:10 nishanthkarthik

@trollixx Could Zeal be changed to be case insensitive?

Kapeli avatar Oct 12 '18 13:10 Kapeli

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

nishanthkarthik avatar Oct 12 '18 13:10 nishanthkarthik

@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.

auscompgeek avatar Oct 12 '18 13:10 auscompgeek

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).

Kapeli avatar Oct 12 '18 13:10 Kapeli

@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?

nishanthkarthik avatar Oct 12 '18 13:10 nishanthkarthik

@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.

Kapeli avatar Oct 12 '18 13:10 Kapeli

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?

GoodGuyNick avatar Oct 12 '18 14:10 GoodGuyNick

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

nishanthkarthik avatar Oct 12 '18 16:10 nishanthkarthik

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

trollixx avatar Oct 13 '18 04:10 trollixx

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

carestad avatar Apr 25 '19 10:04 carestad

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

vvch avatar Jul 09 '20 18:07 vvch

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

TCB13 avatar Dec 14 '20 15:12 TCB13

@TCB13 Different issue, see #1155.

trollixx avatar Dec 15 '20 04:12 trollixx