Copyright: Copyright© 2006, Eric Nitzsche


Dirhtml help
-- Dirhtml 4.73 Help File --

Dirhtml creates index.html files from a directory list using the GUI or command line, optionally including html code of your own design at any point in the generated file. With dirhtml, your index.html files can be unique and arbitrarily complex.

Index of Help pages

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

To get the most out of dirhtml, you need at least a basic understanding of html.  Without it, the generated files will be functional but bland.  An hour spent learning html and ten minutes spent reading Scripts will be rewarded.  Please test the scripts distributed with the program.

To navigate between the various pages, click on the tree or press Ctrl+PgUp, Ctrl+PgDn.

Dirhtml 4.73 and all prior versions are Copyright© 2000-2006 Eric Nitzsche.

Get the current version of dirhtml here.

Dirhtml is freeware.  It contains no ads, cannot be registered, and does not connect to the internet or violate your privacy in any way.  It does only one thing: build html files.


Folder, File Options

Folder	The root folder to build the html file(s) from.  You can enter the folder manually or by clicking the folder button.

File Specification	Files to include as links on the html file.  Multiple files can be included by separating them with semicolons (for example: *.cpp;*.h;*.rc).

Filenames Include	One or more strings that filenames must include to be added to the generated files (for example: lease;indenture).  File matches are not case sensisitive.

Output File	The name of the file(s) to be generated.

Script	HTML code to include, see Scripts for more information.  Different files are used when building a framed site.

Skip These Files	Files you don’t want to link to.  Multiple file types can be specified by using semicolons (for example: *.pch;*.rh;*.obj).

Skip These Folders	Folders you don’t want searched.  Skipped folders won’t appear in the folder table and are ignored while searching recursively.

dirhtml help


Misc. Options
Miscellaneous Options

Include File Size	Includes the size of a file link in the html file

Include File Date	Includes the date of a file link in the html file

Include File Time	Includes the file timestamp in the html file

Summary At Bottom	Adds a summary of links to the bottom of the page

Include Folder Links	Makes links to all subfolders above the file links

Suppress Parent Link	There is no link to the parent folder in the folder table

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 multiples of 1024 bytes (1K)

Suppress Headers	Columns in file and folder tables 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 invisible links:

/FILE_HREF_APPEND

target="_new"><img src="thumbnails/%%F" alt="%%F" border="1"

See Sample Customized Sites

European Style Dates	Formats dates as DD/MM/YY (instead of MM/DD/YY) and times in 24 hour format without am/pm

Use HTML <title> As Link Text	Uses the <title> of a .html, .shtml, .xhtml or .htm file as the link text instead of the filename

Fully Qualified Path To Links	HREF links are fully qualified (for example <a href=”C:/folder/folder/file.txt”>file.txt</a>).  By default, links are relative (for example <a href=”folder/folder/file.txt”>file.txt</a>)

Convert &() to ISO chars	Converts &, (, ) to their html-legal equivalents

Convert HREF Spaces To %20	Converts spaces in <a> links to the html-legal equivalent of %20.  This should always be selected.

Convert Latin Characters	Converts non-english characters (for example ä, ö, ü) to equivalent html codes.  For most browsers, this is not necessary.

Non Functional Links	If selected, file links aren’t functional.  Folder links still work though.

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

dirhtml help


Sorting Options
Sorting and Default Words

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 1	File 4	File 1	File 2

File 2	File 5	File 3	File 4

File 3	File 5

Default Words:

Changes the words visible in generated html files that dirhtml uses by default.  This is primarily used when building pages intended for non english speaking audiences.

dirhtml help


Recursive Options
Recursive

Recursive Build Type:

One HTML File Per Folder	Builds a file in every folder in the branch under the main folder

All Links In One File	Builds a single file linked to all matching files in the folder branch

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.

Include Folder Anchors	Creates links to each section of the generated file.  This only applies if you build with ‘All Links In One File’, ‘Show Folder Names,’ and sort by folder first

Build Files Recursively	Toggles recursive builds on and off

All Links In One File Options:

Show Folders	Shows the folder name before each subsection of links.

Include Folder Anchors	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.

All Links In One File Options:

Page Title Options	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 The Default Output Filename	Appends the default output filename to all folders links.  If this is not selected, most browsers will look for index.html in folders instead of the name of the files being built.

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

dirhtml help


Input/Output Options

Launch Output File	Launches the generated file in your default browser (F12)

Edit Script	Launches the currently selected custom html file in your default text editor (F11)

Read Initialization File	Resets all options from a dirhtml .ini file (F8)

Write Initialization File	Write all dirhtml options to a .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)

dirhtml help


About XHTML

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:

•	Tag names must be in  lowercase  (for example <table>, not <TABLE>).

•	All tags must be properly closed  (for example: <p></p>, not just <p>).

•	Attributes must be quoted.  For example, cellspacing=1 is incorrect; cellspacing=”1” is correct.

•	You can’t use <br>.  Instead, use <br/>.

•	<a name=”…”></a> tags are not supported.  Use <a id=”…”></a>.

•	bgcolor is not a valid <td> attribute.  Use a class or style instead. (for example: <td class=”…”>

•	Scripts need to be in CDATA sections.  For example, this is correct syntax:

<script type="text/javascript">

<!--

//<![CDATA[

var str = "This file was created on: " + document.lastModified;

document.write ( str.fontsize(2) );

document.write ("<p></p>");

//]]>

//-->

</script>

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

dirhtml help


Scripts

Dirhtml has the ability to incorporate any amount of html code into the generated file by parsing 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.  Press F11 to open the current script in your default text editor.

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

Document Related

/DOCTYPE

replaces the default <!DOCTYPE… > with a new html specification

(e.g. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

/HEAD

text here goes into the HEAD

(e.g. <meta name="Author" content="FUBAR Resides Here" />

/START

text here 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 here 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 here REPLACES the <body> line

(e.g. <body background="www.mydomain.com/marble.jpg">)

/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"/>

/BEFORE_ANCHORS

text here appears after the folder table but before the anchor table

Note:  Variables are allowed in this section

/BETWEEN_FILES_AND_FOLDERS

text here appears after the folder and anchor tables

Note:  Variables are allowed in this section

/BEFORE_SUMMARY

inserts html code 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, Folder Table Related

/TABLEHEADER

text here REPLACES the file <table> header line

(e.g. <table cellpadding=”0” cellspacing=”0” border=”2” width=”100%”>)

/FILE_HEADER_TD

adds text to <td>’s in the header row of the file table

(e.g. bgcolor="lightgrey"}

/FILE_TD

replaces <td> for filename links

(e.g. <td class=”some_class”>}

/FILE_TD2

the same as /FILE_TD, but for even numbered rows

/SIZE_DATE_TD

replaces <td align=”right”> for size and date cells

(e.g. <td class=”size_td_class”>}

/FILE_TABLE_ROW2

adds text to <tr> for even numbered rows in the file table

(e.g. class=”even_file_row_class”)

/SIZE_DATE_TD2

the same as /SIZE_DATE_TD, but for even numbered rows

/FOLDER_TABLE_HEADER

text here REPLACES the <table> line for the folder table, see /TABLEHEADER

/FOLDER_HEADER_TD

adds text to <td>’s in the header row of the folder table

(e.g. class=”header_class”}

/FOLDER_TD

replaces <td align=”left”> with a new TD type for items in the folder table

(e.g. <td class=”blah”>}

/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

/ANCHOR

adds text after a folder anchor

(e.g. &nbsp;&nbsp;<a href="#top">top</A>&nbsp;&nbsp<a href="#bottom">bottom</A>

Notes:  Only relevant when folder anchors are generated.

This applies to anchors inside the file table, not to the list of anchors.}

/ANCHOR_TABLE_HEADER

replaces the default anchor table definition (<table cellpadding="0" cellspacing="0" border="0">) with a definition of your own design

{e.g. <table border="0" cellspacing="1" cellpadding="2" width=”100%”>}

/ANCHOR_TD

adds text to the <td> section of a cell containing an anchor in the file table

(e.g. style=”font-weight: bold”}

/ANCHOR_TABLE_TD

adds text to the <td> section of a cell 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 <td> section of the anchor table header cell

{e.g. class="header_td"}

Link Related

/FOLDER_HREF_APPEND

text here is appended to folder HREF links, if any} (e.g. target=”frame2”

Example:  <a href=”folder_link” target=”frame2”>folder_link</a>

/FOLDER_FILE_LINK

text here is added to folder links, if any

(e.g. index.html)

Example:  <a href=”folder_link/index.html”>folder_link</a>

/FILE_HREF_APPEND

text here is appended to file HREF links, if any} (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 here is added after the closing file link HREF </a>, but before the filename </td>

{e.g.  Here is the filename: %%F}

/PRE_FNAME_FILE

text is added before visible file links, not in 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, not in the href

/PRE_FNAME_FOLDER

text is added before visible folder links, not in the href

/POST_FNAME_FOLDER

text is added after visible folder links, not in the href

/FOLDER_PREFIX

text here is added before ALL links, including folder links

(e.g. some_folder/)

Example I:  <a href=”some_folder/file.html”>file.html</a>

Example II: given a Custom HTML File 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 this option to add your own, arbitrary HTML code to the created page.  Section names can be absent, repeated, or be in random order.  If a section is repeated, the text within it is added to the previous data.

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.

dirhtml help


Variables
Script Variables

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

%%DIR	 inserts the current fully qualified pathname (for example: C:\Windows\Desktop)

%%FOLDER	 inserts the current folder name (for example: Desktop)

%%DATE	 inserts the date and time

%%F	 inserts the current filename.  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:  %%FILEwhatever.txt% inserts the contents of the file named whatever.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.

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

Scripts

dirhtml help


Batch Files
Using Dirhtml Batch Files

Once you set up dirhtml to build file(s) to your satisfaction, press F7 or click the 'Save Batch File' button in Input/Output.  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 customized ini file.

{Power user hint: Copy the text of multiple batch files into a single batch file to rebuild multiple files or an entire site simultaneously.}

dirhtml help


Sample Customized Sites

--- The following is an example if you want to generate a site of thumbnailed links to images ---

Note: There are many freeware applications that generate thumbnail web pages better than dirhtml. I personally use and recommend JAlbum.

Step 1) Create thumbnail images

•	Create thumbnail images of all the graphics of interest using appropriate software.  I recommend Irfanview, which is freeware.  Note that Irfanview names the generated thumbnail files oddly.  You will need to use a file renamer to fix them.

•	Save them in a folder named ‘thumbnails’ under the folder with the images

Step 2) Create a Script

•	Create a text file with these contents:

/FILE_HREF_APPEND

target="_new"><img src="thumbnails/%%F" alt="%%F" border="1"

•	save it as ‘thumbnail.txt’ in the same folder as dirhtml.exe

Step 3) Build the file

•	Select the folder with the images in File, Folder Options

•	Enter ‘*.jpg’ in ‘File Specification’ in File, Folder Options

•	Enter ‘thumbnail.txt’ in the Custom HTML File edit box (Text Options)

•	Select ‘Suppress Visible Link Text’ in True/False Options

•	Click ‘Build’ (F3)

dirhtml help