How to call webhelp for CSH

<oXygen/> general issues.
maglid
Posts: 39
Joined: Mon Sep 28, 2009 8:10 am

How to call webhelp for CSH

Post by maglid » Fri Jul 18, 2014 7:54 am

I want to do context-sensitive help using Oxygen Webhelp output (DITA source files). This would be on the file system where an application is installed. It looks like I can call the help system with a specific HTML file displayed with a syntax like the following:

file:///C:/Users/joe/path/webhelp/index.html#Managing_Projects.html

Can I do the same thing if I use an alias number somehow? I'd rather not have to use raw filenames. Like this:

file:///C:/Users/joe/path/webhelp/index.html#12345

I can generate an alias file to map to. Or is there some better way?

Thanks,
Mark

sorin_ristache
Posts: 4144
Joined: Fri Mar 28, 2003 2:12 pm

Re: How to call webhelp for CSH

Post by sorin_ristache » Fri Jul 18, 2014 2:20 pm

Hello,

You have to provide the path to the Webhelp page relative to the output base directory (file:///C:/Users/joe/path/webhelp in your case) as an anchor that follows the index.html file name. The relative path of the Webhelp page is necessary for loading it in the right-side frame of the browser page. You can add a second anchor in the URL if you want to scroll the right-side frame to a particular section or paragraph. This second anchor is the value of an id attribute from the XML source file so it can have any format suitable for an ID attribute value. But you can't avoid the relative path as the first anchor in the URL.

For example look at this URL that points to a paragraph inside a topic so that an automatic scroll is needed in the browser:

http://www.oxygenxml.com/doc/ug-editor/ ... mation__p2


Regards,
Sorin

maglid
Posts: 39
Joined: Mon Sep 28, 2009 8:10 am

Re: How to call webhelp for CSH

Post by maglid » Fri Jul 18, 2014 9:55 pm

Thanks for the information, it is useful.

But I wanted to know if I could use an alias number instead of hard-coded paths and filenames of HTML files. With context-sensitive help in an installed application, it is normal to use aliases instead of hard-coded filenames and paths. You create a mapping file that maps IDs to files. Like this:

1001 file1.html
1002 file2.html
1003 file2.html#marker1
etc.

So in the application there will be the XYZ dialog box with the id 1002, and when you click the Help button on that dialog box it calls the help system with the argument 1002. Something like this:

file:///C:/Users/joe/path/webhelp/index.html#1002

Using an alias file makes it more flexible than using hard-coded filenames. You can change the filename without affecting the program.

Can I do this somehow with Oxygen webhelp?

sorin_ristache
Posts: 4144
Joined: Fri Mar 28, 2003 2:12 pm

Re: How to call webhelp for CSH

Post by sorin_ristache » Mon Jul 21, 2014 5:21 pm

Hello,

I suggest to generate a mapping file in your application that maps the IDs to file names, like:

Code: Select all

1001  file1.html
1002 file2.html
1003 file2.html#marker1
You can create also a new file called index.htm or index_custom.html that is located in the same directory as index.html and includes JavaScript code that reads the above mapping file and redirects the URL received from the application, like file:///C:/Users/joe/path/webhelp/index_custom.html#1003 to the Webhelp page generated by the Oxygen application, like file:///C:/Users/joe/path/webhelp/index.html#file2.html#marker1.


Regards,
Sorin

maglid
Posts: 39
Joined: Mon Sep 28, 2009 8:10 am

Re: How to call webhelp for CSH

Post by maglid » Mon Jul 21, 2014 9:23 pm

Great idea, thanks for the suggestion Sorin.

Mark

Post Reply