GNOME Bugzilla – Bug 316833
GNU documentation not available in yelp
Last modified: 2006-01-07 19:19:02 UTC
This bug has been opened here: http://bugzilla.ubuntu.com/show_bug.cgi?id=7719 "... There is a load of documentation in /usr/share/info, none of it I can find in yelp. Documentation on stuff like wget, make, screen, gpgme, flex, automake-1.9, bash, cvs, etc."
This is basically about there being no index for info files. "yelp info:///folder/file.gz" works fine but there is no index for info files
The file named 'dir' is the usual table-of-contents file for an info-file repository. So perhaps ubuntu isn't distributing one (more correctly generating it on-the-fly after each package installation probably)? Does yelp info:///usr/share/info/dir work? It *tries* to work for me (yelp-2.12.0) but dumps core (as for many .info files it seems...still diagnosing) New-feature-wise, I think when fed a directory via a info:// URI, yelp should attempt to open a file named "dir" if it exists in that directory before just crashing with an "Could not load document...invalid or does not point to an actual file" error. And when built with --enable-info, the main page should parse the "dir" in INFOPATH and link them like it does for manpages iff --enable-man.
Created attachment 54620 [details] [review] "yelp info:///folder/" tries info:///folder/dir
Created attachment 54622 [details] [review] Fix leak in attachment #54620 [details]
Created attachment 54624 [details] [review] Search for "dir" for info: URIs "yelp info:///folder/" uses info:///folder/dir (if it exists). "yelp info:" uses the first info:///$f/dir among all $f in INFOPATH (if one exists). Cleaner handling of temp-string variable.
Created attachment 55846 [details] [review] A different approach This creates a table-of-contents section (on the front page) for info pages. This is generated from the dir file. If it aint present, no info pages show up and you'll get a warning about a non-existant section. The subsections are generated from the subsections in the dir file (as there seems to be no real standards on this).
Works great here! I did get a weird error at startup though: /opt/gnome2//share/yelp/info.xml:0: error : unterminated entity reference development tools Additionally, if my man cache patch goes in, then in yelp-toc-pager.c the first line in the function process_info_pending() will need to be changed: -YelpDocInfo *dir = yelp_doc_info_new ("info:(dir)"); +YelpDocInfo *dir = yelp_doc_info_new ("info:(dir)", FALSE); I noticed that some sections showed up twice, e.g. "Programming" was there twice, but the entries in each were different so this is probably because there are actually two categories in the "dir" file
Good approach Don! Indeed there are no standards for section names...every .info file declares whatever section it wants (and sometimes package-manager package maintainers override this choice as well)...it's a giant mess:( Gotta just use whatever is there (perhaps alphabetize the sections (case-insensitively) and alphabetize the node-names within them?) Regarding the duplicate sections of comment 7, the install-info script that creates dir *should* append to existing sections instead of making duplicates. I wonder if you have a hand-patched file, or there's some subtle difference between the two "Programming" ones? I think it's still important to keep the ability to have info: URIs that point to a path give the dir from that path. Some systems do have multiple info collections, each with their own dir, and no system-wide or unified dir, and this feature would avoid having to know that "dir is the table of contents of a given info directory".
A couple of points: 1. The unterminated entity reference: I don't get that at all. Seems pretty weird. In the dir file, is there an empty section "developement tools"? Or is it at the end of the dir file? Otherwise, I'm a bit stumped about this. 2. The sections showing up twice etc.: Yes, its due to different sections in the dir file. I've got 2 Programming sections as well, but 1 is "Programming" and the other is "Programming:". I've started to file bugs downstream about this (for Ubuntu), in the hopes they can nag people enough to fix this up a bit, or at least fix it for them. 3. Since the man cache patch has been committed, I'll roll another patch to fix it against CVS Head when I get home. 4. The sections should be automatically alphabetised, as well as the nodes within them, due to xslt goodness. 5. The patch I have doesn't support different dirs. Trying to load "yelp info:$PATH_TO_NEW_DIR/dir" or any info:dir will still result in yelp crying. This seems to be a pretty tricky problem to solve. Again, I'll have a look at this when I get home (again). I'll also look at getting different dir's included in the toc.
Created attachment 56780 [details] [review] Updated As promised, an updated version. A couple of improvements: 1. It now supports different info page collections, provided each collection is in the info_path and has a dir file. The caveat being that if the same filename is found in both, only 1 will show up (e.g. if the automake-1.4 info page is in 2 different collections it will only show up once in the listings). 2. The multiple entries of the same category name mention by Brent should now be taken care of - if the same category appears twice, they are all lumped in together. 3. trying to load info:dir should bring you to the TOC for info pages. Plus several small bugfixes.
DonS: seems rock solid to me. My vote is for a commit to HEAD ;-) I'd even go for turning on info pages by default. Shaun, try this patch now! Marking priority HIGH for more review and testing and updated versions.
Patch has now been committed to CVS HEAD. Closing