帮助手册中的锚不起作用 [英] Anchors in help-book not working
问题描述
我已经仔细检查了所有内容,希望有人能找到我没有看到的愚蠢错误.
我正在尝试为我的应用程序构建一个Apple帮助部分,它可以正确转到登录页面,但是所有锚点均无效.登陆页面称为 index.html
,另一页面称为 test.html
,位于 pgs
目录中.
在index.html中,我有:
< a href ="help:anchor = support bookID = com.company.app_name.help">链接到另一个页面</a>
在test.html中,我有:
< a name ="support"></a>
因此,这是我为了现在所处位置所遵循的步骤:
1)我构建了 这也是我 index.html 的代码: 这是 test.html的代码. 这是我的帮助文件的Info.plist . 我也关注了这篇文章: http://www.cocoabuilder.com/archive/cocoa/312037-updating-an-app-help.html ,除了重新索引目录之外,每次进行更改时都要清除缓存. 谢谢! 当然,David,感谢您的提醒. 根据我记得的内容和草率的文档,我运行以下命令来索引帮助文档文件: 但是我意识到的一件事是,只要使用 我认为这就是我的问题. I've double checked everything and hoping someone can find a stupid mistake that I'm not seeing. I'm trying to build a Apple Help section for my application and it correctly goes to the landing page however none of the anchors work. The landing page is called In index.html I have: In test.html I have: So here's the steps that I followed in order to get to where I am right now: 1) I built the directory as specified by the Apple documentation 2) I built the Help Info.plist as specified in the Apple documentation. Included in the Info.plist I set the 3) In my app Info.plist I set the 4) I then copied the directory that I built into Xcode while ensuring that I selected the option Create Folder References for any added folders. 5) Then I used Help Indexer to index the directory That's it. There's a couple of things that I noticed about my application if I place the following link in the index.html file it works correctly. Also here is my code for the index.html: Here is the code for the test.html. Here is the Info.plist for my Help file. Also I followed this post:http://www.cocoabuilder.com/archive/cocoa/312037-updating-an-app-help.html to clear out the cache every time I make a change in addition to re-indexing the directory. Thanks all! Sure David,
Thanks for the reminder. From what I recall and my sloppy documentation I run the following command to index the help documentation files: However one thing that I realized is the index utility will complain any time the I think that was the bug in my case. 这篇关于帮助手册中的锚不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
<!DOCTYPE html PUBLIC-//W3C//DTD XHTML 1.1//EN""http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><; html xmlns ="http://www.w3.org/1999/xhtml">< head>< title> AppName帮助</title>< meta http-equiv ="Content-Type" content ="text/html; charset = utf-8"/><元名称=机器人" content ="noindex"/>< meta name ="AppleTitle" content ="AppName帮助"/>< meta name ="AppleIcon" content ="../shrd/icon.png"/></head><身体>< a href ="help:anchor = support bookID = com.company.app_name.help">链接到另一个页面</a></body>
<?xml version ="1.0" encoding ="utf-8" standalone ="no"?><!DOCTYPE html PUBLIC-//W3C//DTD XHTML 1.1//EN""http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">< html xmlns ="http://www.w3.org/1999/xhtml">< head>< title>测试链接</title>< meta http-equiv ="Content-Type" content ="text/html; charset = utf-8"/><元名称=机器人" content =锚"/></head><身体>< a name ="support"></a>链接有效吗?< br/></body></html>
<?xml version ="1.0" encoding ="UTF-8"?><!DOCTYPE plist PUBLIC-//Apple//DTD PLIST 1.0//EN""http://www.apple.com/DTDs/PropertyList-1.0.dtd">< plist version ="1.0">< dict>< key> CFBundleDevelopmentRegion</key>< string> en_us</string>< key> CFBundleIdentifier</key>< string> com.company.app_name.help</string>< key> CFBundleInfoDictionaryVersion</key>< string> 6.0</string>< key> CFBundleName</key>< string> AppName</string>< key> CFBundlePackageType</key>< string> BNDL</string>< key> CFBundleShortVersionString</key>< string> 2</string>< key> CFBundleSignature</key>< string> hbwr</string>< key> CFBundleVersion</key>< string> 2</string>< key> CFBundleHelpBookName</key>< string> AppName帮助</string>< key> HPDBookAccessPath</key>< string> index.html</string>< key> HPDBookIconPath</key>< string> shrd/icon.png</string>< key> HPDBookIndexPath</key>< string> search.helpindex</string>< key> HPDBookKBProduct</key>< string> app_name1</string>< key> HPDBookKBURL</key>< string> http://www.company.com</string>< key> HPDBookRemoteURL</key>< string> http://www.company.com</string>< key> HPDBookTitle</key>< string> AppName帮助</string>< key> HPDBookType</key>< string> 3</string></dict></plist>
hiutil -vCaf ./search.helpindex English.lproj
& nbsp;
字符,索引实用程序就会抱怨.而是用字符 
index.html
and the other page is called test.html
which is located in the pgs
directory. <a href="help:anchor=support bookID=com.company.app_name.help">Link to another page</a>
<a name="support"></a>
AppName.help/
Contents/
Info.plist
Resources/
shrd/
English.lproj/
index.html
search.helpindex
pgs/
test.html
CFBundleIdentifier
to com.company.app_name.help
.CFBundleHelpBookFolder
to AppName.help
and set CFBundleHelpBookName
to com.company.app_name.help
AppName.help
. Making sure that I select the option to Index anchor information in all files.I then copied the .helpindex file to the English.lproj folder where it's supposed to be.<a href="pgs/test.html">Click this link</a>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>AppName Help</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex" />
<meta name="AppleTitle" content="AppName Help" />
<meta name="AppleIcon" content="../shrd/icon.png" />
</head>
<body>
<a href="help:anchor=support bookID=com.company.app_name.help">Link to another page</a>
</body>
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Testing Links</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="anchors" />
</head>
<body>
<a name="support"></a>Does linking work?<br/>
</body>
</html>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en_us</string>
<key>CFBundleIdentifier</key>
<string>com.company.app_name.help</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>AppName</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>2</string>
<key>CFBundleSignature</key>
<string>hbwr</string>
<key>CFBundleVersion</key>
<string>2</string>
<key>CFBundleHelpBookName</key>
<string>AppName Help</string>
<key>HPDBookAccessPath</key>
<string>index.html</string>
<key>HPDBookIconPath</key>
<string>shrd/icon.png</string>
<key>HPDBookIndexPath</key>
<string>search.helpindex</string>
<key>HPDBookKBProduct</key>
<string>app_name1</string>
<key>HPDBookKBURL</key>
<string>http://www.company.com</string>
<key>HPDBookRemoteURL</key>
<string>http://www.company.com</string>
<key>HPDBookTitle</key>
<string>AppName Help</string>
<key>HPDBookType</key>
<string>3</string>
</dict>
</plist>
hiutil -vCaf ./search.helpindex English.lproj
character is used. Instead substitute the character