Re: Help Indexing
Re: Help Indexing
- Subject: Re: Help Indexing
- From: "Frank D. Engel, Jr." <email@hidden>
- Date: Fri, 14 Apr 2017 21:17:40 -0400
Thanks; I managed to clear all of the errors (which took some doing),
but the anchors still are not working.
As an example, one of my files contains:
<a name="refLayers"></a>
I added some debugging output to my method:
- (void)showHelpAnchor:(NSString *)what
{
NSLog(@"help: '%@'", what);
NSString *locBookName = [[NSBundle mainBundle]
objectForInfoDictionaryKey: @"CFBundleHelpBookName"];
[[NSHelpManager sharedHelpManager] openHelpAnchor:what
inBook:locBookName];
}
I am getting this logged in the console when I click on the relevant button:
help: 'refLayers'
If the help window is already open, it stays where it is - no change in
page. If it is not open, it opens to a blank page.
Note that if I use the option from the Help menu to get to the TOC page
(which is how I set up my opening page), I can easily navigate to the
same page manually.
On 4/13/2017 21:53, Jerome Krinock wrote:
On 2017 Apr 13, at 16:46, Frank D. Engel, Jr. <email@hidden> wrote:
Hi, I am trying to create an Apple Help book … help buttons on the interface trying to access specific pages using anchors, and these are not working.
I generated an index using the "hiutil" command, and when I reran that and enabled verbose output (hiutil -Cavv ...), I got a bunch of output like this:
Contents/Resources/English.lproj/pgs/doc70.html -- Parse error: The operation couldn’t be completed. (NSXMLParserErrorDomain error 76.)
...
The pages open just fine in a web browser, but it looks like the hiutil command is trying to parse it as XML? That obviously won't work... these are regular HTML files, not XML.
I’ve been down this road. As you’ve surmised, your anchors are probably failing because your help book is not being indexed. The reason why it is not being indexed is because hiutil is much more strict than a web browser. You need to get rid of those Parse errors, every single one of them. Don’t worry about XML. If I recall correctly, when I ran my pages through a good HTML syntax checker like https://validator.w3.org, it showed me the issues and after I fixed them and the syntax checker was happy, hiutil was happy, and all my anchor buttons worked.
There may have ben other details I forgot, so if someone else wants to jump in, please do.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden