![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
![]() ![]() |
Since XML is at the root of single-sourcing formats, you want to be using standard coding with no proprietary features. So, make "clean" HTML or XHTML code and avoid creative coding, which can cause trouble porting to any future platform like XML, other lanuages or XML subsets like DocBook, DITA or AML. You can check thsi by Tidy. Converting WinHelp (HLP) to HTMLHelp (CHM) by using a decompiler or old WinHelp projects I described separately before. Some examples below are related to this article.
Tidy and other tools like FAR (http://www.helpwaregroup.com/products/far) can be used to help move over to proper XHTML & CSS code.
HTML TIDY is a free utility and works great on the atrociously hard to read markup generated by specialized HTML editors and conversion tools.Tidy is able to fix up a wide range of problems. Each item found is listed with the line number and column so that you can see where the problem lies in your markup. Tidy won't generate a cleaned up version when there are problems that it can't be sure of how to handle. These are logged as "errors" rather than "warnings".
It's usually best to verify the HTML code suggested by HTML Tidy before updating the original file. However, if you're comfortable with updating the original files without verifying the HTML code, the following solution can be used with the command line version of HTML Tidy. This is a solution using Tidy for many HTML files from the command-line - but use at your own risk.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">
<TITLE>First Topic</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<OBJECT TYPE="application/x-oleobject" CLASSID="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
<PARAM NAME="Keyword" VALUE="First Topic">
</OBJECT>
<H1><A NAME="first_topic"></A><IMG SRC="../images/riffel_helpinformation.gif"
ALT="" BORDER=0> First Topic </H1>
<P><B>First Topic</B></P>
<P>This is the first topic for context-sensitive help.</P>
<P>This is s tree</P>
<P><IMG SRC="../images/eiche.gif" ALT="" BORDER=0></P>
<P>Having trees in your garden you must have:</P>
<P> 1.Numbered item one</P>
<P> 2.Numbered item two</P>
..
During this Tidy pass, the code was cleaned
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="HTML Tidy for
Windows (vers 14 February 2006), see www.w3.org" />
<meta http-equiv="Content-Type" content="text/html;
charset=us-ascii" />
<title>First Topic</title>
<style type="text/css">
/*<![CDATA[*/
body {
background-color: #FFFFFF;
color: #000000;
}
p.c1 {font-weight: bold}
/*]]>*/
</style>
</head>
<body>
<object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
<param name="Keyword" value="First
Topic" />
</object>
<h1><a name="first_topic" id="first_topic"></a><img
src="../images/riffel_helpinformation.gif" alt="" border="0"
/> First Topic</h1>
<p class="c1">First Topic</p>
<p>This is the first topic for context-sensitive help.</p>
<p>This is s tree</p>
<p><img src="../images/eiche.gif" alt=""
border="0" /></p>
<p>Having trees in your garden you must have:</p>
<p>1.Numbered item one</p>
<p>2.Numbered item two</p>
..
<head>
<meta name="generator" content="HTML Tidy for Windows (vers 14 February 2006), see www.w3.org" />
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
<link href="../hh_default.css" rel="stylesheet" type="text/css" />
<title>First Topic</title>
<style type="text/css">
/*<![CDATA[*/
body {
background-color: #FFFFFF;
color: #000000;
}
p.c1 {font-weight: bold}
/*]]>*/
</style>
</head>Open your HTMLHelp project file e.g. winh_to_hh.hhp with Notepad and add the following line:
[FILES] hh_default.css html\winh4qgg.htm html\winh7jzk.htm html\winh052b.htm html\winh8a3n.htm html\winh57z7.htmCompile your project again. As you can see there is a header derived from the stylesheet and universally valid for all HTML files.
![]() |