hhc file of CHM to html - html

I have created a chm file using HTML Help workshop and it works fine in Windows. However the chm viewer used in Linux is not so good and I prefer not to use it in Linux. I am also restricted from using any other viewers in Linux. So I thought of decompiling the chm and create HTML files which can be used in Linux. However on decompiling, the hhc file generated, though contains the HTML tags, does not display properly in the browser.
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Main">
<param name="Local" value="Main.html">
</OBJECT>
The above code just displays only a bullet and nothing else. Is there a way by which the data in the param tags can be used. Like it displays Main as a link to Main.html.
NOTE: I don't want to use browser in Windows, so avoiding chm file as such is not a solution. Also I will have to make changes in multiple places if I use chm in Windows and separate HTML file for Linux. So the option I am thinking of is to use the HTML files generated by decompiling the chm in Linux.

You know, .hhc files contain the Table of Contents (TOC) for an HTMLHelp file (CHM), i.e. the entries displayed
in the left pane of the CHM viewer window. It's compiled into the CHM file.
An .hhc file is referred to as a sitemap file. Sitemap is a file format developed and proposed by Microsoft to the World Wide Web Consortium. Sitemap files control many navigation features for CHM files, such as the table of contents and index panes.
Please note HTMLHelp and all this is about 20 years old! The .hhc sitemap file was not standardised (standardized) by W3C e.g. as HTML5 and is a old proprietary Microsoft file format today.
I'd recommend using a so called web-based help under LINUX. If you really have permanent updates of your help topic content you'll need to survey your workflow.
Some thoughts (as I understand your needs):
Low budget and the man's way by using HTMLHelp Workshop (use of tools
recommended e.g. like FAR
HTML
Think about single-sourcing - one source of topics and different target formats (e.g. CHM, web-based (uncompressed help) on a server)
Think about your CHM file as a compiled web, create the HTML topics in structured folders like a web page (best use case for the wizards of FAR HTML)
Create a CHM file from source
Create a uncompressed web based help from source by uploading the web to Intranet or Internet (HTML files, images, ...), completed by a handmade Table of Contents derived from the .hhc file
But, don't decompile. Have single-sourcing in mind - I'd recommend using a time saver tool like mentioned above. To see what I mean navigate to following links:
Example 1: Uncompressed help - a bit dated
Example 2: FAR Web help created using FAR HTML.
For further information go to FAR HTML Tour and scroll down to uncompressed help.

Related

Iframe contents not visible in a chm file

I am compiling one chm file with set of html files. In one html file i am using iframe tag and viewing text file throught 'src' attribute. I am able to see the contents of text file inside iframe when opening that HTML file in a browser. But when viewing that file in a chm file i don't see text file content. It is showing 'This page can’t be displayed' error in iframe.
This is the tag i'm using:
<iframe src="./mytextfile.txt" style="width: 100%; height: 300px;border:none"></iframe>
Is there anything to add to view that file. Please help me.
As you can see - your problem is reproducible (here on a German Windows10 machine).
You must ensure that the text file is either in the same directory as the project (.hhp) file or in a subdirectory of that directory.
You also have to add the *.txt file extension or filename to the [FILES] list in the .hhp file, as this ensures that the text file will be compiled into the .chm file. Best way is to do this by a text editor like shown below:
Save the *.hhp file and compile all content to your *.chm file.
Done!
BTW - here are some hints to another problem may be targeted:
Microsoft introduced some security restrictions many years ago that disable functionality in HTML Help files that are accessed over a network, so what you're seeing is almost certainly by design. There are two possible solutions: move the help file to your local drive, or implement some changes in the Windows registry so that you can view the contents of remote help files.
Microsoft's summary of the problem: http://support.microsoft.com/kb/896054
You may try following workaround that lets you explicitly 'unblock' a CHM help file coming from a network drive or internet download. To do this:
Open Windows Explorer
Find your CHM file
Right click and select Propertie
Click the Unblock button on the General tab
For information on how to make the registry changes, see this page:
http://www.grainge.org/pages/authoring/chm_mspatch/896358.htm
Or more straightforwardly, use the free HHReg utility available from the page below to make the required changes.
http://www.ec-software.com/products_hhreg.html

Is there any way to bundle HTML/CSS/IMAGES?

I am pretty new to web design, so this may be a very elementary question. I have a folder where I have multiple HTML files for a simple web page, I also have CSS style sheets and JPGs for the web backgrounds. I want to send the sample website to my friends via email, but there are about 10 files in a folder. Is there any way to bundle them to make it simpler for a non-programmer to open and view the website?
In short: No.
You should really just send them a zip folder containing the different HTML files, CSS files, and images. That way they can just decompress the zip, open up the default document (i'm guessing index.html) and view the website locally on their machine. If you'd like further explanation please let me know.

Convert gnome-help (yelp) xml to static html with xslt

Some of the gnome applications on linux use a help browser called yelp. For example, the gnome-calculator, gcalctool, has its help files located in /usr/share/gnome/help/gcalctool
The folders there are then sorted by language. These help files essentially consist of an xml file and some accompanying png figures.
What I'm trying to do is convert this xml and its accompanying png figures into static HTML because I want to be able to properly view and navigate the document from a different browser (firefox). If you want to see what I'm talking about and you are on Linux, just run gcalctool and open the help menu.
Unfortunately, opening the xml directly with firefox is not successful because there are no stylesheets and thus firefox doesn't know how to format it. I have read that gnome applications make use of a library called libxslt (http://xmlsoft.org/libxslt/) for applying stylesheets. I am not familiar with xslt at all. Are the stylesheets saved elsewhere, or embedded in the source when it is compiled?
I guess what I'm wondering is if it's possible to somehow use libxslt by itself or another tool to convert the xml and figures into static HTML, preferably in the same manner yelp does this when it executes, or in a manner that results in an exact/very similar output to what yelp displays.
Thanks
gcalctool uses docbook. Yelp brings everything to display this xml format. You will find some projects to convert this docbook document to html on http://wiki.docbook.org/DocBookToXhtml.
best regards
Majo
Depending on how old your gcalctool is, its help files might be in DocBook or Mallard. If it's Mallard, you'll see a bunch of .page files. Otherwise, it's DocBook. Either way, you can use yelp-build to create HTML files. It's part of the yelp-tools package, and uses the same transformations as Yelp. For DocBook, pass the top-level XML file:
yelp-build html -o /path/for/output/ /path/to/gcalctool.xml
For Mallard, pass the directory containing the .page files:
yelp-build html -o /path/for/output/ /path/to/gcalctool/
yelp-build will build the HTML, copy the images and other media files, and take care of the CSS and JavaScript.

Is there a way to export a page with CSS/images/etc using relative paths?

I work on a very large enterprise web application - and I created a prototype HTML page that is very simple - it is just a list of CSS and JS includes with very little markup. However, it contains a total of 57 CSS includes and 271 javascript includes (crazy right??)
In production these CSS/JS files will be minified and combined in various ways, but for dev purposes I am not going to bother.
The HTML is being served by a simple apache HTTP server and I am hitting it with a URL like this: http://localhost/demo.html and I share this link to others but you must be behind the firewall to access it.
I would like to package up this one HTML file with all referenced JS and CSS files into a ZIP file and share this with others so that all one would need to do is unzip and directly open the HTML file.
I have 2 problems:
The CSS files reference images using URLs like this url(/path/to/image.png) which are not relative, so if you unzip and view the HTML these links will be broken
There are literally thousands of other JS/CSS files/images that are also in these same folders that the demo doesn't use, so just zipping up the entire folder will result in a very bloated zip file
Anyway -
I create these types of demos on a regular basis, is there some easy way to create a ZIP that will:
Have updated CSS files that use relative URLs instead
Only include the JS/CSS that this html references, plus only those images which the specific CSS files reference as well
If I could do this without a bunch of manual work, if it could be automatic somehow, that would be so awesome!
As an example, one CSS file might have the following path and file name.
/ui/demoapp/css/theme.css
In this CSS file you'll find many image references like this one:
url(/ui/common/img/background.png)
I believe for this to work the relative image path should look like this:
url(../../common/img/background.png)
I am going to answer my own question because I have solved the problem for my own purposes. There are 2 options that I have found useful:
Modern browsers have a "Save Page As..." option under the File menu, or in Chrome on the one menu. This, however does not always work properly when the page is generated by javascript
I created my own custom application that can parse out all of the CSS/Javascript resources and transform the CSS references to relative URLs; however, this is not really a good answer for others.
If anyone else is aware of a commonly available utility or something like that which is better than using the browser built in "Save page as..." option - feel free to post another answer.

Strange problem while compiling CHM file

I had to write some documentation. I wrote each page in MS Word and then save each *.docx as htm file. I'm using "HTML Help Workshop" (from microsoft) to compile a chm file.
I was able to sucessfully create a chm file but the problem is that not all images in chm file are displayed. I tried decompiling the *.chm file into another folder and opened each .htm file in web browser. All images are correctly displayed.
Then why aren't they displayed in chm file. Strangely, only some of them aren't displayed. I checked if image format is causing problem, but all images are of same format. I checked if file naming is a problem, but all images are named like image[001-100].jpg in their corresponding folders.
Any idea about whats going wrong?
HTML Help Workshop (HHW) is known to have problems with the HTML generated by Word (or better put: Word generates terrible HTML). Some versions put VML coding around the IMG tags that HHW cannot handle.
Possible solutions:
In Word: Deselect the option 'Rely on VML for displaying graphics in browsers' (Tools > Options > General > Web Options)
In Word: Save as 'filtered HTML'.
In HHW: Manually add the images to the project's [FILES] section.
Let me know if any of this helps.
More information can be found in the HTML Help 1.X FAQ