简体   繁体   English

CHM(htmlhelp)搜索关键字

[英]CHM (htmlhelp) search for keyword

I'm trying to interface the htmlhelp api (which is a big word for one function in two variants), and I have a problem with the following usecase: 我正在尝试连接htmlhelp api(这是两个变体中的一个函数的一个大词),我遇到以下用例的问题:

Assume I have a simple programmer's editor, with a bunch of helpfiles (.CHMs). 假设我有一个简单的程序员编辑器,带有一堆帮助文件(.CHMs)。 Some are from the core runtime library, some from more exotic libraries. 有些来自核心运行时库,有些来自更具异国情调的库。 Assume the CHMs are crafted normally, and their indexes contains all keywords I want to search. 假设CHM正常制作,它们的索引包含我想要搜索的所有关键字。 I want to be simply able to search through the various CHMs when a user presses F1 on a keyword in the editor 当用户在编辑器中按下关键字上的F1时,我希望能够简单地搜索各种CHM

So roughly I want (in pseudo code): 所以粗略我想要(在伪代码中):

firstchm
while not (out of CHMs) and not Found
   {
         if keyword in CHM then
           {
             found=true;
             break;
           }  
      nextchm;  
    }

I've played a bit with HH_HELP_TOPIC, but that would pop up a window for every attempted file, and worse it would be dog slow since the CHMs would not remain cached. 我已经玩了一些HH_HELP_TOPIC,但是这会为每个尝试过的文件弹出一个窗口,更糟糕的是它会慢得多,因为CHM不会保持缓存状态。

Is there really no solution except DIY with eg chmlib? 除了带有例如chmlib的DIY之外,真的没有解决方案吗? Or is it worth making a study of merged CHM files first? 或者是否值得首先研究合并的CHM文件?

Language is Delphi or clone, but anything win32/COM and somewhat readable will do. 语言是Delphi或克隆,但任何win32 / COM和一些可读性都可以。

(edit) Search results for nested index entries might be the next problem: HTML Help keyword lookup (/edit) (编辑)嵌套索引条目的搜索结果可能是下一个问题: HTML帮助关键字查找 (/ edit)

update 2 After a long time, I got a potential hint elsewhere. 更新2经过很长一段时间,我在其他地方得到了一个潜在的暗示。 Craft a CHM runtime that merges all the other CHMs. 制作合并所有其他CHM的CHM运行时。 Windows will generate CHWs for it containing all the slave CHM's TOC and indexes. Windows将为其生成包含所有从属CHM的TOC和索引的CHW。 Requires Binary TOC=off and Binary Index=on though, for all slave CHMs, and a CHM compiler installed/available. 但是,对于所有从属CHM和安装/可用的CHM编译器,需要二进制TOC =关闭和二进制索引=打开。 But since that is CHM workshop default, that might be not too bad. 但由于那是CHM研讨会的默认,这可能不是太糟糕。

Do you want to create an index or do a one-time search for these keywords? 您想创建索引还是要对这些关键字进行一次性搜索?

Couldn't you extract the HTML content from the CHM files with logical filenames, search the HTML content, and relate that back to the CHM file? 难道您无法从具有逻辑文件名的CHM文件中提取HTML内容,搜索HTML内容并将其与CHM文件相关联吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM