Command-line option for generating help context file

Nothing is perfect! This is where you can post your ideas and wishes for functions you'd like to see in Help & Manual. Current version only please (H&M7).

Moderators: Alexander Halser, Tim Green

Post Reply
rossmcm
Posts: 66
Joined: Sun Nov 11, 2007 10:57 pm
Location: New Zealand (Auckland)

Command-line option for generating help context file

Unread post by rossmcm »

The ability to carry out the functions of the Tools/Help Context Tool menu entry via command line switches would allow the entire project to be produced from a batch file. At present this step needs to be carried out manually.
lilleyt
Posts: 75
Joined: Thu Jul 06, 2006 5:42 pm

Unread post by lilleyt »

I second this.
ahaer
Posts: 8
Joined: Thu Nov 08, 2007 8:58 pm

Unread post by ahaer »

That would be great. I have made make files for chm and pdfs, but still have to hand export the help context files
hiran
Posts: 65
Joined: Thu Jul 24, 2008 9:00 am

Unread post by hiran »

I found this topic as I also wish to generate the help output formats with a batch script - especially as there are some more steps to perform after H&M has finished.
H&M 5.1.1 build 750
rossmcm
Posts: 66
Joined: Sun Nov 11, 2007 10:57 pm
Location: New Zealand (Auckland)

Re: Command-line option for generating help context file

Unread post by rossmcm »

12 years later, a quiet nudge for this feature, please. :-(

It has occurred to me that it might be possible to write a tool to perform this so I have done this. It's a batch file and while it's reasonably elegant (for a batch file, anyway), it only produces a file suitable for use with my toolchain (Delphi) and a solution based on a tool built into H&M would be much cleaner.
User avatar
Tim Green
Site Admin
Posts: 23153
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Command-line option for generating help context file

Unread post by Tim Green »

Hi Ross,

Thanks for the suggestion, I've passed it on to the development team. One question: Are you using this for CHM files or also for something else? I ask because CHM is clearly going the way of WinHelp and the Dodo; it's future is anything but bright... 8)
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.
rossmcm
Posts: 66
Joined: Sun Nov 11, 2007 10:57 pm
Location: New Zealand (Auckland)

Re: Command-line option for generating help context file

Unread post by rossmcm »

Hi Tim,

I'm using one source to produce CHM, PDF and HTML.

I think that every time they "improve" windows help it gets worse. The biggest disaster (not really MS's fault, this one) was when Embarcadero/Codegear/whatever they were called that month - used the MS document explorer to host the Delphi 2007 help. It was a disaster. Luckily they released a CHM version of it later on.
User avatar
Tim Green
Site Admin
Posts: 23153
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Command-line option for generating help context file

Unread post by Tim Green »

rossmcm wrote:I'm using one source to produce CHM, PDF and HTML.

OK, but are you using the context tool output for all those formats or just for CHM?
I think that every time they "improve" windows help it gets worse.
Although Windows itself really has got a lot better, the state of Microsoft's help systems is still, shall we say, somewhat sub-optimal... :x
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.
rossmcm
Posts: 66
Joined: Sun Nov 11, 2007 10:57 pm
Location: New Zealand (Auckland)

Re: Command-line option for generating help context file

Unread post by rossmcm »

OK, but are you using the context tool output for all those formats or just for CHM?
Ah, OK. I export the help context numbers and produce a .INC file with const declarations. Those are used for context-sensitive CHM help in the Delphi app, so yes, just for CHM.
User avatar
Alexander Halser
EC-Software Support
Posts: 4098
Joined: Mon Jun 24, 2002 7:24 pm
Location: Salzburg, Austria
Contact:

Re: Command-line option for generating help context file

Unread post by Alexander Halser »

Hi Ross,

If you produce the help project from a batch file, why not include the help context numbers directly into the project XML? I don't really see what a command line option for the help context tool could do here.

The help context list is stored in the .HMXP file. You find it in:

Code: Select all

<helpproject>
  <config>
    <helpcontext-numbers>
      <helpcontext-number href=topicid value=number>

Example from "HELPMAN.HMXP":

    <helpcontext-numbers>
      <helpcontext-number href="HM_Advanced" value="7240"/>
      <helpcontext-number href="HM_Advanced_Baggage" value="7930"/>
      <helpcontext-number href="HM_Advanced_Baggage_DeleteRename" value="7960"/>
      <helpcontext-number href="HM_Advanced_Baggage_Editing" value="11161"/>
      <helpcontext-number href="HM_Advanced_Baggage_External" value="7940"/>
      <helpcontext-number href="HM_Advanced_Baggage_Handling" value="7970"/>
      <helpcontext-number href="HM_Advanced_Baggage_Uses" value="11081"/>
      <helpcontext-number href="HM_Advanced_CommandLine" value="7860"/>
    </helpcontext-numbers>
Alexander Halser
Senior Software Architect, EC Software GmbH
rossmcm
Posts: 66
Joined: Sun Nov 11, 2007 10:57 pm
Location: New Zealand (Auckland)

Re: Command-line option for generating help context file

Unread post by rossmcm »

Yup, that's pretty much how I'm doing it via my klunky batch file. Given a project name, I:
  • find <project>.hmxz
  • extract project.hmxp from it
  • use grep on project.hmxp to get all lines matching the regexp "helpcontext\-number\ href\=.*value\=" to file <project>.inc
  • use FART (wonderful utility!) to change lines in file <project>.inc from:
    <helpcontext-number href="Accuracy_and_Resolution" value="904200"/>
    to
    const HELP_Accuracy_and_Resolution = 904200 ;
In fact, not many of these declarations are used within the Delphi sources, just for cases where it was more convenient to refer to a topic with a name instead of a number. Most of the help context properties are assigned at design time with the help topic add-on.
Post Reply