Help File Sections
Folders, Files Scripts
Miscellaneous Script Variables
Sorting and Default Words     XHTML
Recursive Batch Files
Input, Output

Dirhtml generates customizable html files from a directory branch.

Dirhtml v4.77 is Copyright© 2000-2006 Eric Nitzsche.

Download the current version of dirhtml here.

Dirhtml is freeware.

Folder The root folder to build the html file(s) from.
File Specification Files to include as links in generated html files.  Multiple file types can be included by separating them with semicolons.
Output File The name of the file(s) to be generated.
Filenames Include    Patterns that filenames must match, separated by semicolons.
Filenames Exclude Patterns that filenames can't match, separated by semicolons.
Title The html <title> of generated pages.
Script The script used to generate file(s).  Different scripts are used when building a framed site.
Skip These Folders    Patterns that folders can't match, separated by semicolons.

Pattern matching notes:

Top of the help file

Include File Size Includes the size of file links
Include File Date Includes the date of file links
Include File Time Includes the timestamp of file links
Summary At Bottom Adds a summary of links to the bottom of generated files
Use /r/n For Line Breaks End of line markers in html files use /r/n instead of /n
Include Folder Links Makes a separate table with links to all subfolders above the file table
Suppress Parent Link There is no link to the parent folder in the folder table
Use File Table Script Elements For All Tables Folder and anchor table script elements are copied from file table elements
Insert Commas Into File Sizes Formats sizes with commas (for example: 1,234 instead of 1234).  '.' Is used instead of ',' if 'European Style Dates' is selected.
File Sizes Shown in K's Shows file sizes in rounded multiples of 1,024 bytes (1K)
Suppress Headers Table columns have no headers
Suppress Extensions Links are shown without the extension (for example, 'something.txt' would appear as 'something').
Suppress Visible Link Text Generated link text is not visible.  This is only useful when building a site of thumbnailed images.
Example script, which is required to have usable invisible links:
/FILE_HREF_APPEND
target="_new"><img src="thumbnails/%%F" alt="%%F" border="0"></img
European Style Dates Formats dates as DD/MM/YY (instead of MM/DD/YY) and times in 24 hour format without am/pm
Build 16-bit Unicode Files Generated html files use 16-bit unicode character encoding instead of 8-bit.  Use of a custom content-type and/or configuring your web server to transmit files in little-endian order is recommended.  Note: 16-bit files are twice as large as 8-bit files.
Use HTML <title> As Link Text Uses the <title> of a .html/.shtml/.xhtml/.htm file as the link text instead of the filename
Fully Qualified Path To Links    HREF links are fully qualified (for example: <a href="file:///C:/folder/folder/file.txt">file.txt</a>).  By default, links are relative (for example: <a href="folder/file.txt">file.txt</a>)
Convert & to &amp; Converts & to &amp; in links
Convert HREF Spaces and ;'s Converts spaces and semicolons in <a> links to %20 and %3B.  This should always be selected.
Convert Latin Characters Converts non-english characters (for example ä, ö, ü) to equivalent html codes.  This is generally not necessary, and can result in a very time consuming build process.
Non-Functional Links Links have no href component (except internal anchor links); useful for printing generated files
Force Rectangular Tables Adds extra <td>'s as needed to make all <tr>'s have the same number of <td>'s.
Anchors Use Backslashes Uses \ rather than / to designate folders in anchors and folder names
Doctype Selects html 4.01 transititional, html 4.01 strict, xhtml 1.0 transitional or xhtml 1.0 strict file generation
File Columns Number of columns in the file table
Folder Columns Number of columns in the folder table
Anchor Columns Number of columns in the anchor table

Top of the help file

Sorting Options:
Sort By Determines the primary key for the sorting filenames.  If "Name" is not selected, filename will be used as the secondary sort key.
Sort Order Selects the sort order
Sort Folders First If selected, folders are sorted before the "Sort By" key.  If the file is not built recursively with "All links in one file," all files are in the same folder and this step is skipped.
Sort By Columns    If selected, a column-wise sort is performed after the primary sort.

Column-wise Sort Example     Regular Sort Example
  File 1File 4  File 1File 2
  File 2File 5  File 3File 4
  File 3File 5

Default Words:

Changes the default words used in generated html files.

Top of the help file

Build Files Recursively:    Toggles recursive builds on and off.  A recursive build includes all subfolders of the main folder.

Recursive Build Type:
All Links In One File Builds a single file linked to all matching files in the folder branch
One HTML File Per Folder    Builds a file in every folder with matching files in the branch under the main folder
Build A Framed Site Builds a frameset, a file for the left frame with folder links only, and a file in every folder in the branch with matching files.

All Links In One File Options:
Show Folder <tr> Subsections    Shows the folder as a separate <tr> before each subsection of links.  These are the anchor targets if an anchor table is generated.
Create A Folder Anchor Table    Creates a table below the folder table with "id=..." links to each folder subsection.
Note: Both of these options are only relevant when folders are sorted first.

One HTML File Per Folder Options:
HTML <title> Selects the html <title> for generated files.
Don't Build File In The Root Folder    Does not build a file in the topmost folder.  This is useful if a different sort of build is needed for the root file.
Link Folders To Generated Files    Appends the default output filename to all folder links.  If this is not selected, most browsers will look for index.html instead of the files being built.

Framed Site Options:    Manages the scripts used for frameset components.  The frameset file is copied wholesale and not altered.  Filenames for the left and right frame files are extracted from the frameset file.

Top of the help file
Launch Output File Launches the generated file in your default browser (F12)
Edit Script Launches the currently selected script in your default text editor (F11)
Read Configuration File Reads all options from a dirhtml .ini file (F8)
Write Configuration File    Writes all dirhtml options to an .ini file (F9)
Save Batch File Creates a batch file that builds the same file(s) that would be built if you clicked 'Build.' (F7)

Top of the help file

Dirhtml can incorporate additional html code into generated files by parsing a text file, called a "script."  Use this option to make your generated html files unique.  Please test all the scripts that come with dirhtml.

Using scripts is not as daunting as it may at first appear.  If you are not comfortable with coding html by hand, copy/paste code from the html editor of your choice.  Pressing F11 opens the current script in your default text editor.

Script sections: File Table, Folder Table, Anchors, Link

Below is a description of possible sections in a script file:

Document Related

SectionDescription, Use
/DOCTYPE Replaces the default <!DOCTYPE... > with a new html specification
(e.g. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">)
/HEAD Text goes into the HEAD
(e.g. <link rel="stylesheet" type="text/css" href="mystyle.css">)
/START Text is inserted after the <body> line
(e.g. <p><b>Below is a list of files...</b></p)
Note: variables are allowed in this section
/END Text is added at the end of the file, before </body>
(e.g. <p><a href="mailto:me@mydomain.com"><i>Email The Webmaster</i></a></p>)
Note: variables are allowed in this section
/BODYHEADER Text replaces the <body> line
(e.g. <body background="http://www.mydomain.com/marble.jpg">)
Note: Customizing BODY with css is probably a better solution
/CONTENT_TYPE Replaces the default Content-Type line in the <head> section
(e.g. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>)
Note: to have no Content-Type, add a blank line with one space
/BEFORE_ANCHORS Text appears after the folder table but before the anchor table
Note: variables are allowed in this section
/BETWEEN_FILES_AND_FOLDERS    Text appears after the folder and anchor tables, just before the file table
Note: variables are allowed in this section
/BEFORE_SUMMARY Inserts text just before the summary statistics at the bottom of the page
(e.g. <p><b>Summary statistics for links on this page:</b></p>)
/SUMMARY_STYLE Inserts text into the the <p> that contains the summary statistics
(e.g. style="font-weight: bold")

File Table Related     Script sections: Document, Folder Table, Anchors, Link

SectionDescription, Use
/TABLEHEADER Text replaces the file <table> definition
(e.g. <table cellpadding="0" cellspacing="0" border="2" width="100%">)
/FILE_HEADER_TD Adds text to <th>'s in the header row of the file table
(e.g. class="fileheader_class")
/FILE_TD Adds text to <td>'s containing filename links  (Note: changed in v4.75)
(e.g. class="file_class")
/FILE_TD2 The same as /FILE_TD, but for even numbered rows
/SIZE_DATE_TD Adds text to <td>'s containing size, time and date cells  (Note: changed in v4.75)
(e.g. class="size_td_class")
/SIZE_DATE_TD2 The same as /SIZE_DATE_TD, but for even numbered rows
/FILE_TABLE_ROW2    Adds text to <tr> for even numbered rows in the file table
(e.g. class="even_file_row_class")

Folder Table Related     Script sections: Document, File Table, Anchors, Link

SectionDescription, Use
/FOLDER_TABLE_HEADER    Text replaces the folder <table> definition, see /TABLEHEADER
/FOLDER_HEADER_TD Adds text to <th>'s in the header row of the folder table
(e.g. class="header_class")
/FOLDER_TD Adds text to the <td> for items in the folder table  (Note: changed in v4.75)
(e.g. class="folder_td_class")
/FOLDER_TD2 The same as /FOLDER_TD, but for even numbered rows
/FOLDER_TABLE_ROW2 Adds text to <tr> for even numbered rows in the folder table
(e.g. class="even_folder_row_class")

Anchor Related     Script sections: Document, File Table, Folder Table, Link

SectionDescription, Use
/ANCHOR Adds text after a folder anchor
(e.g. &nbsp;&nbsp;<a href="#top">Top of page</a>)
Notes:  Only relevant when building one file recursively, sorting folders first and showing folders.
This applies to anchors inside the file table, not to the anchor table.
/ANCHOR_TABLE_HEADER    Replaces the anchor <table> definition
(e.g. <table border="0" cellspacing="1" cellpadding="2" width="100%">)
/ANCHOR_TD Adds text to the <td> of cells containing an anchor in the file table
(e.g. style="font-weight: bold")
/ANCHOR_TABLE_TD Adds text to the <td> of cells in the anchor table
(e.g. class="anchor_element_td")
/ANCHOR_TABLE_TD2 The same as /ANCHOR_TABLE_TD, but for even numbered rows
/ANCHOR_TABLE_ROW2 Adds text to <tr> for even numbered rows in the anchor table
(e.g. class="even_anchor_row_class")
/ANCHOR_HEADER_TD Adds text to the <th> of cells in the anchor table header
(e.g. class="header_td")

Link Related     Script sections: Document, File Table, Folder Table, Anchors

SectionDescription, Use
/FOLDER_HREF_APPEND    Text is appended to folder HREF links (e.g. target="frame2")
Example:  <a href="folder_link" target="frame2">folder_link</a>
/FOLDER_FILE_LINK Text is added to folder links (e.g. index.html)  '/' is automatically added first
Example: <a href="folder_link/index.html">folder_link</a>
/FILE_HREF_APPEND Text is appended to file HREF links (e.g. target="_new")
Example: <a href="file.html" target="_new">file.html</a>
Note: %%F will insert the current filename in the append text, e.g. alt="%%F" would become <a href="file.html" alt="file.html">file.html</a>
/POST_HREF_FILE Text is added after the closing file link HREF </a>, but before the <td>
(e.g. Here is the filename: %%F)
/PRE_FNAME_FILE Text is added before visible file links, after the href >
Example: given "ZZ " as /PRE_FNAME_FILE, links will look like <a href="file.doc">ZZ file.doc</a>
/POST_FNAME_FILE Text is added after visible file links, before the </td>
/PRE_FNAME_FOLDER Text is added before visible folder links, after the href >
/POST_FNAME_FOLDER Text is added after visible folder links, before the </td>
/FOLDER_PREFIX Text here is added before ALL links, including folder links
(e.g. some_folder/)
Example: given a script with...
/FOLDER_PREFIX
ftp://mydomain.com/

... links will look like this:  <a href="ftp://mydomain.com/file.html">file.html</a>
(Note: You MUST include a trailing slash.)

Use scripts to add your own, HTML code to the generated pages.  Section names can be absent, repeated, or be in random order.  If a section is repeated, the text within it is appended to any existing data.

If you are not sure what a particular section does, create a script with that section only and examine the file it builds.

This is a basic script:
/HEAD
<style type="text/css">
<!--
html, body {
  border: 3px groove;
  padding: 6px;
  font-family: sans-serif;
-->
</style>
/START
<p style="text-align: center; font-size: large"><b>%%DIR</b></p>

If you need an HTML reference, try this site.  If you are reading this, you probably also use (or should use) an html validator.  I recommend W3C for online validation, CSE HTML Validator for offline validation and Web Developer if you are using Firefox.

Anything in a script file before the first section section name is ignored, and can be used for commenting the file.

Top of the help file

The following variables can be used in /START, /END, /BETWEEN_FILES_AND_FOLDERS, /BEFORE_ANCHORS and /BEFORE_SUMMARY:

%%DIR Inserts the fully qualified path (for example: C:\Windows\Desktop)
%%FOLDER    Inserts the folder (for example: Desktop)
%%RELATIVE_PATH    Inserts the path relative to the root folder (for example: \Desktop\Folder)
%%DATE Inserts the date and time
%%F Inserts the filename  (Note: only works in /FILE_HREF_APPEND and /POST_HREF_FILE sections)
%%FILE Inserts the contents of a text file.  The filename must be followed by %.
Example:  %%FILEsome_file.txt% inserts the contents of the file named some_file.txt.
Note: Absent a path, dirhtml will look for the file in the folder being searched first, then in the same folder as dirhtml.exe.
%%SUMMARY    Inserts the summary statistics
%%INCLUDES    Inserts the filenames include string
%%SKIPPED    Inserts the filenames exclude string
%%SPEC Inserts the file specification

%%FILE, %%DIR and %%FOLDER can also be used in /HEAD

Top of the help file

Dirhtml can (optionally) produce web pages compliant with strict or transitional xhtml 1.0.  Xhtml is very similar to html 4.0, with a few exceptions.  The idea behind xhtml is that it's a bridge between html and pure XML.  Xhtml will be the successor to html 4.0.

Naturally, to the extent your scripts are not xhtml compliant, generated files will not be xhtml compliant either.

For more information on xhtml, try a Google search or this page.

Some of the differences between xhtml 1.0 and html 4.0 include:

You can change the target doctype on the Miscellaneous page or by redefining /DOCTYPE in a script.

Top of the help file

Once you set up dirhtml to build file(s) to your satisfaction, press F7 or click the 'Save Batch File' button on Input/Output page.  This will allow you to rebuild the file(s) by double clicking the batch file instead of using the GUI interface, which is very handy if you are rebuilding files repeatedly or many files simultaneously.  Dirhtml will automatically create the batch file linked to a ini file incorporating all current settings.

Any dirhtml ini file can be opened by pressing F8, edited, and saved with F9.

Top of the help file