zeal
zeal copied to clipboard
In javascript docset if...else page not opening
Ubuntu 18.04.1, Zeal 0.6.0
Can't open page for if...else
in javascript docset.
The same goes for anything that has ...
in the name.
@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
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)
@trollixx Could Zeal be changed to be case insensitive?
@Kapeli The links are simple browser openable file://
links and they are handled with case sensitivity on firefox Linux too.
@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.
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 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 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
andint.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.
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 let's keep it open. We'll probably come up with a permanent fix
I guess it's time to implement #138...
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
Not only 'Statements' folder, but also 'Global_Objects', 'Operators' and may be others. Seems like there may be many such folders
All javascript docs seems to be broken as of now:
Same with HTML:
Maybe this is an issue with Mozilla Docs?
v 0.6.1
@TCB13 Different issue, see #1155.