chuckhoupt / jekyll-apple-help

Easily create Apple Help-Books for your Mac OS X app using this Jekyll template and build system.
MIT License
188 stars 17 forks source link

Indexing help #20

Open tripledee opened 5 years ago

tripledee commented 5 years ago

Hello. Thanks for this nice tool! I try to index the Apple Help created with jekyll-apple-help (using keywords I put in .md pages). When compiling the project, a search.helpindexfile is created in the English.lproj directory but it seems that it is ignored when I search in the Help window of my application. Any idea of what I missed? Thanks

chuckhoupt commented 5 years ago

By "keywords", do you mean HTML meta keywords, or just free text in the page's body? Example meta-keywords:

<meta name="keywords" content="dog, cat">

Jekyll-Apple-Help should index both via hiutil, but I'll run some tests to verify that. Possibly the problem is due to the Apple Help system caching or accessing an old version of a help bundle.

tripledee commented 5 years ago

Thanks for your fast answer!

yes, I use HTML meta keywords. When I compile the help, hiutil is run and a search.helpindex file is well created (and populated with much content, omitting the keywords though). But any search term in Help window returns no result…

I erased all built files and restarted from scratch, but nothing changes. I got the same behaviour with your myApp sample project.

chuckhoupt commented 5 years ago

I can reproduce the issue -- when new content is added to help (meta-keywords, body text), the HelpViewer ignores the new .helpindex file. So far the only workaround I can suggest is to logout/login -- that appears to clear some cache, allowing searching for new index terms.

tripledee commented 5 years ago

Ok. I will try that ASAP

tripledee commented 5 years ago

I got no change after logout/login, even a computer restart. I just discovered that one topic page seems to be indexed (the content in page and the content of the left menu). But cannot obtain that the dozen other topic pages be indexed…

chuckhoupt commented 5 years ago

Ok. You might double-check that the app's Help Book Identifier (CFBundleHelpBookName) correctly matches the Bundle Identifier (CFBundleIdentifier) of the help book. I found a bug in the example app, which causes a mismatch. The result was that search failed. I've committed a fix in d86ced1d3aadd806b2032ed1a5b2480bde19d653.

Here is what the Info.plist's should contain:

MyApp.app/Contents/Info.plist:

    <key>CFBundleHelpBookFolder</key>
    <string>MyAppHelp.help</string>
    <key>CFBundleHelpBookName</key>
    <string>com.example.MyApp.help</string>

MyAppHelp.help/Content/Info.plist:

    <key>CFBundleIdentifier</key>
    <string>com.example.MyApp.help</string>
tripledee commented 5 years ago

I have the same settings, alas... I tried to run hiutil in the Terminal, erase helpd and helpviewer caches, restarted the computer... and still no use of the index file by the Help Viewer application