Replacing .chm with eBooks problem

Please post all questions on Help+Manual 8 here

Moderators: Alexander Halser, Tim Green

User avatar
Greg Smith
Posts: 203
Joined: Thu Feb 01, 2007 4:52 pm
Location: Cambridge, England

Replacing .chm with eBooks problem

Unread post by Greg Smith » Fri Feb 21, 2020 6:26 pm

We have used .chm format for many years and the one feature that seems to be absent in eBooks is a way to lookup topics by index entries, which we make quite a bit of use of. Is there any way to achieve this in eBooks?

User avatar
Tim Green
Site Admin
Posts: 21624
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Replacing .chm with eBooks problem

Unread post by Tim Green » Sat Feb 22, 2020 9:12 am

Hi Greg,

You can include a keyword index in eWriter in the same way as in WebHelp. Or do you mean searching for associative links using A-keywords? That is a CHM technology that isn't available in WebHelp, and eWriter is basically packaged WebHelp.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.

User avatar
Greg Smith
Posts: 203
Joined: Thu Feb 01, 2007 4:52 pm
Location: Cambridge, England

Re: Replacing .chm with eBooks problem

Unread post by Greg Smith » Mon Feb 24, 2020 12:55 pm

I am used to using the original WinHelp and now HtmlHelp Windows API to link our applications to the associated Help. The interface you describe for eBooks seems based on a command line... Is there any help for migrating to eBooks from HtmlHelp.

HtmlHelp allows us to lookup text that appears in the index in addition to context numbers (which we also use heavily). Can you explain how to do this lookup... Sorry if this is very simple, but I do not know where to look to find out where the command line interface is documented.

User avatar
Tim Green
Site Admin
Posts: 21624
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Replacing .chm with eBooks problem

Unread post by Tim Green » Mon Feb 24, 2020 1:21 pm

Hi Greg,

EWriter can't use A-Links, which are the foundation of what you describe here, because that is something that only exists in CHM. I'm afraid there can't be any support for migrating that, because it's impossible. You simply cannot use keywords to link to topics like that anywhere else. The only option is to delete those links and replace them with direct links to the actual topics you want to reference. That can't be done automatically because there is no reference to those topics anywhere in your project that could be converted -- only to the keywords. As an aside, those references wouldn't work in any other output format either. They have only ever worked in CHM, and indirectly also in WinHelp before that; but WinHelp is even deader than CHM, and CHM has been expiring on artificial life support for quite a few years now.

You can find the documentation on how to make calls to eWriter here:

https://www.helpandmanual.com/help/hm_w ... tions.html

The same syntax is also documented in the chapter on links:

https://www.helpandmanual.com/help/hm_a ... riter.html
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.

User avatar
Greg Smith
Posts: 203
Joined: Thu Feb 01, 2007 4:52 pm
Location: Cambridge, England

Re: Replacing .chm with eBooks problem

Unread post by Greg Smith » Wed Feb 26, 2020 1:08 pm

OK... I've got everything to work as well as it can, but the lack of a keyword lookup is a big problem for us. Some background:
Our application contains a scripting language and our users are used to being able to click anywhere and get context sensitive help on whatever is round the cursor. This has been implemented by detecting the text entity around the cursor and telling the .chm help to look it up in the full text index. This makes for a nice user experience with lookups based on matching index entries.

As I understand things, this capability does not exist in eViewer.

So my request is that you implement a command line option to do this. What I would like would be something along the lines of:

eViewer "file.ewriter" /k "text to left match"

And for the system to do a case insensitive match into the index and open any matching pane.

Incidentally, I much prefer the .chm display with the keyword text entry above the index to the index style in eViewer with a different page for searching.

User avatar
Tim Green
Site Admin
Posts: 21624
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Replacing .chm with eBooks problem

Unread post by Tim Green » Wed Feb 26, 2020 3:45 pm

Hi Greg,
So my request is that you implement a command line option to do this. What I would like would be something along the lines of:
That won't be possible. To understand why, I need to explain what eWriter is: It is, actually, WebHelp. But it's WebHelp stored in a single archive file. The eViewer uses the Windows WebView component for the HTML, CSS and JS rendering and its own encapsulated web server. So what you are doing is opening a web page on a web server, just as if it were online, but in an encapsulated local server environment. So you don't have that kind of feature that was available in CHM, just as you don't have it in regular WebHelp either. :?
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.

User avatar
Greg Smith
Posts: 203
Joined: Thu Feb 01, 2007 4:52 pm
Location: Cambridge, England

Re: Replacing .chm with eBooks problem

Unread post by Greg Smith » Thu Feb 27, 2020 4:46 pm

I realise that, but surely .eWriter is your format so you can add additional information, like an efficient lookup table... The prospect of getting away from the moribund CHM format is appealing, as is the prospect of a potential cross-platform Help system.

However, having spent a few days working on this, I feel that .eWriter may not be for us (yet). Currently, I know our customers would see it as worse than what they had.

The only way to I can see to achieve what we already have with chm in eWriter is to (somehow) export the index from the H&M output, process it ourselves to generate a keyword lookup to translate to topic IDs, then make the help links do the lookup. It is not that hard to do, but feels like having a dog and barking (especially when all the information needed to do this is already in the eWriter file).

User avatar
Tim Green
Site Admin
Posts: 21624
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Replacing .chm with eBooks problem

Unread post by Tim Green » Thu Feb 27, 2020 5:10 pm

Hi Greg,

I understand your situation and we may be adding something like that in the future. At the moment, however, we have our work more than cut out for us with handling support for the new release.

On balance, I would say that anyone who depends strongly on A-keyword lookup for CHM should stay with CHM for the moment. I'm actually quite surprised that anyone is still using it. I always found it horribly clunky myself and much more trouble than it was worth. :wink:
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.

User avatar
Greg Smith
Posts: 203
Joined: Thu Feb 01, 2007 4:52 pm
Location: Cambridge, England

Re: Replacing .chm with eBooks problem

Unread post by Greg Smith » Thu Feb 27, 2020 7:13 pm

Are we talking at cross-purposes here? I do not use A-Keywords at all (AFAIK); all my A-Kewords for HTMLHelp panels in all my topics are empty.

I use index entries and and tell the .chm viewer to look them up with code equivalent to:

HH_AKLINK link;
...fill in link...;
HWND hWnd = ::HtmlHelp(nullptr, fName, HH_KEYWORD_LOOKUP, &link);
if (hWnd)
::SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);

This gives me a handle to the Help window which I can make a topmost window.

Of course, this may be what you mean by A-Keywords.

User avatar
Martin Wynne
Posts: 2608
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: Replacing .chm with eBooks problem

Unread post by Martin Wynne » Thu Feb 27, 2020 8:09 pm

Hi Greg,

I don't think what you are describing is A-keywords.

I'm reading what you want to do is to search the keywords in the index, and open the topic to which the searched-for keyword is linked?

You could do that by adding some scripting to the kwindex page template, something like

Code: Select all

function open_kw(search_text);
{
  var kwords=document.getElementsByTagName('span');
  var i;

  for (i=0; i<kwords.length; i++)
  {
    if (kwords[i].textContent=search_text && kwords[i].parentNode.tagName='A')
      {
      kwords[i].parentNode.click();
      break;
      }
  }
}
cheers,

Martin.
Last edited by Martin Wynne on Fri Feb 28, 2020 7:56 am, edited 1 time in total.

User avatar
Tim Green
Site Admin
Posts: 21624
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Replacing .chm with eBooks problem

Unread post by Tim Green » Fri Feb 28, 2020 7:38 am

Hi Greg,

You're right: That's a lesser-used functionality in the HH_ space that allows you to search for regular keywords. It would be possible to set something like that up in a skin for eWriter, and for WebHelp as well, for that matter, since eWriter IS WebHelp. I'm putting it on my list to see if that can be added.

There is a caveat, however: At least in the current iteration of the viewer, you would still have to call it using the eViewer.exe "<your arguments here>" syntax, since what you are passing to the viewer is really just an URL that gets executed in the encapsulated browser and web server. The eViewer is just a web page container, it is not WebHelp-specific per se. That is why the standalone eWriter Creator is available for anyone to put any web page they design themselves into it.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.

User avatar
Greg Smith
Posts: 203
Joined: Thu Feb 01, 2007 4:52 pm
Location: Cambridge, England

Re: Replacing .chm with eBooks problem

Unread post by Greg Smith » Fri Feb 28, 2020 6:01 pm

Thanks Martin and Tim,

That sounds much more hopeful. My concern is that the search, to be really useful, needs to be case insensitive and I do not have enough knowledge of Javascript and webbery to know if this would work.

Not sure what you mean, Tim, by having to use "eViewer.exe "<your arguments here>" syntax"... I can arrange to change our code to do just about anything as long as it is available from C++ in the Windows environment.

Having the ability to look up keywords (as long as case agnostic) would be great.

Perhaps also an example of how to modify a skin to allow you to pipe a command line argument to some JavaScript would be useful to non-HTML/JavaScript folks like me.

User avatar
Martin Wynne
Posts: 2608
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: Replacing .chm with eBooks problem

Unread post by Martin Wynne » Fri Feb 28, 2020 7:36 pm

Greg Smith wrote:
Fri Feb 28, 2020 6:01 pm
My concern is that the search, to be really useful, needs to be case insensitive
Hi Greg,

For a case-insensitive string search, use the equalsIgnoreCase() method on the first one.

Code: Select all

if (str_1.equalsIgnoreCase(str_2))
{  
cheers,

Martin.

User avatar
Martin Wynne
Posts: 2608
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: Replacing .chm with eBooks problem

Unread post by Martin Wynne » Fri Feb 28, 2020 7:58 pm

Greg Smith wrote:
Fri Feb 28, 2020 6:01 pm
Perhaps also an example of how to modify a skin to allow you to pipe a command line argument to some JavaScript would be useful to non-HTML/JavaScript folks like me.
Hi Greg,

To get the parameters in a URL, use window.location.search which returns the ?part of the URL.

cheers,

Martin.

User avatar
Martin Wynne
Posts: 2608
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: Replacing .chm with eBooks problem

Unread post by Martin Wynne » Sat Feb 29, 2020 2:53 am

Hi Greg,

The V2 eWriter skins already include a keyword search option. To open eWriter at the keyword index, and scroll to and highlight an existing keyword, use the URL switch functions. You need to add a parameter string such as:

Code: Select all

"index.html?index=blue%20bananas"
when opening the eWriter. Your user then has a highlighted index entry to click. Replace any spaces with %20 when making the call.

It is a case-insensitive search.

cheers,

Martin.

Post Reply