The information in this document applies to:
HTML-Kit's "File Mappings" feature can be used to preview files that cannot be previewed without a host file, such as stylesheets, stand-alone JavaScript files, etc., and other files that browsers may not be able to render without the help of an external application, such as server-side scripts and non-HTML files. This document describes how to create file mappings for common file types.
The File Mappings feature can be used to preview certain types of files within a customizable host file. For example, a HTML file can be setup to be the host file for style sheets, to make it possible to preview stand-alone *.css files through it.
How to create a file mapping for cascading style sheets
- Create a HTML file that include elements and classes defined in the style sheet. For example, create a file named c:\css_host.htm and enter the following code. Note that "{{TEXT}}" is a special field name used to indicate where to insert the content of the style sheet being previewed.
<html>
<head>
<title>CSS Host File</title>
<style type="text/css">
<!--
{{TEXT}}
-->
</style>
</head>
<body>
<h2>Testing...</h2>
</body>
</html>
- Select "Edit | Preferences" from HTML-Kit's main menu and change to the "Preview" tab.
- Check "Enable file mappings" and click "Edit Preview Rules."
- Click "Add" under "File mappings."
- Enter "css" (without quotes) and click "OK;" "css" being the file extension used by style sheets. Multiple file extensions can be separated using the ";" character -- "css;css2;css3"
- Enter the full path to the host file: "c:\css_host.htm"
- Click "OK," "OK" and "OK" to apply the new settings.
Now it's possible to preview *.css files without creating specific HTML files to link them. To test the file mapping, open a style sheet file with the *.css extension and click the "Preview" tab in the editor. HTML-Kit will create a new file on-the-fly based on the host file and the style sheet, making it possible to preview the style sheet through the host file.
How to create a file mapping for ASP, JSP and PHP pages
- Since most ASP, JSP and PHP pages containing server-side scripts include at least the basic HTML code (html, head, body, etc.), it may not be necessary to include HTML code in the host file. Create a HTML file that contain the text "{{TEXT}}" (without quotes), and save it as c:\ss_host.htm. For example:
{{TEXT}}
- Select "Edit | Preferences" from HTML-Kit's main menu and change to the "Preview" tab.
- Check "Enable file mappings" and click "Edit Preview Rules."
- Click "Add" under "File mappings."
- Enter "asp" (without quotes) and click "OK." Change the extension if necessary to match the type of files being targetted. For example, use "jsp" to preview JSP files using the *.jsp file extension.
- Enter the full path to the host file: "c:\ss_host.htm"
- Click "OK," "OK" and "OK" to apply the new settings.
Now HTML-Kit will be able to preview the content of *.asp files (or other file type containing server-side scripts) without requiring a server capable of parsing the scripts. Note that only the unparsed content (HTML or text) will be previewed, not the end result of the script. To test the file mapping, open a file with the *.asp extension and click the "Preview" tab in the editor.
Document ID: H000132
Reviewed On: 15-Oct-2001
THE INFORMATION IN THIS DOCUMENT IS PROVIDED ON AN AS-IS BASIS WITHOUT WARRANTY OF ANY KIND.
PROVIDER SPECIFICALLY DISCLAIMS ANY OTHER WARRANTY, EXPRESS OR IMPLIED, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL PROVIDER BE LIABLE FOR ANY CONSEQUENTIAL, INDIRECT, SPECIAL OR INCIDENTAL DAMAGES, EVEN IF PROVIDER HAS BEEN ADVISED BY "USER" OF THE POSSIBILITY OF SUCH POTENTIAL LOSS OR DAMAGE. "USER" AGREES TO HOLD PROVIDER HARMLESS FROM AND AGAINST ANY AND ALL CLAIMS, LOSSES, LIABILITIES AND EXPENSES.