Back arrow Next arrow

Dirhtml Help - Notes

Search Details    To add code showing details about the current search at the top of generated pages, use something along these lines:
/START
<p style="text-align: center; margin-top: 0px; font-weight: bold">
<span style="font-size: x-large">%%DIR</span><br />
<span style="font-size: large">
Files: %%SPEC<br />
Include: %%INCLUDES<br />
Exclude: %%SKIPPED</span><br />
%%DATE</p>
Auto‑generated index files    To automatically regenerate server index files upon access, use PHP.  Configure dirhtml as follows:
  • Set the folder (F4) to "."
  • Set the output file to "list.html"
  • Exclude files matching "build_html" (and possibly also "list.html")
  • Turn auto-launch of generated files off
  • Create a batch file (F7) in the folder of interest named "build_html.bat"
  • Create a PHP file with these contents: (to be saved as "index.php")
    <? exec ('build_html.bat');
    $file = file_get_contents ('list.html');
    echo $file;
    ?>
  • Launch the automatically regenerated file by opening index.php
  • Note that the batch file can also point to a generic .ini file on the server.  It is also possible to redirect any index file on a server folder branch to a recursively built file using similar methods.

Index.html can be redirected to the index.php file by overwriting it with this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head><meta http-equiv="REFRESH" content="0;url=index.php"></head>
<body></body>
</html>
Network Drives Dirhtml can search network drives that are accessible via Network Places.  FTP servers must be mapped to a drive letter using appropriate software (such as Netdrive.exe).
Fully qualified links will not work for local files that index servers taking the form \\server\blah (the server folder must be mapped to a drive letter via Tools->Map Network Drive in Windows Explorer).
Deleting Strings    Pressing Delete while a drop-down list is open deletes the focused string from the list.
Chopped Files If a generated file gets cut off in mid-file, one or more indexed filenames probably has a non-ascii character that is being interpreted as an end of file marker.  Use a UTF-8 or UTF-16LE character set if this occurs.
Save/Restore Settings    When a particular build works well, save the settings by pressing F9.  The settings be can reopened later with F8.
Daunting Scripts Some of the scripts distributed with dirhtml are complex.  It's not necessary to learn every section to customize scripts.  Editing a script (F11) and adding some code the the /START section can provide useful results.  Most of the distributed scripts define table properties with CSS and can be used a starting point.
Tooltips To see tooltips for dropdown lists, hover over the down arrows.
Page Jumping Pressing Ctrl+1 through Ctrl+9 opens the correspondingly numbered dirhtml tab.  Ctrl+PgUp, Ctrl+PgDn scroll through the tabs.
Server PointingTo make links points point to a particular server use a folder or file prefix.
Stupid TrickDepending on the locale, your operating sytem may sort _ before other characters.  Try renaming folders and files with _ as the first character (e.g. _saved.ini), so they will appear first in file managers.
Two columns example  To duplicate the two columns sample web page layour, select the div_recursive.txt script (F5), edit it (F11) and follow the instructions at the top of the file.
Including per-folder filesWhen building a single recursive file, it is possible to include a specific file in folder headers using a %%FILE...% variable.  Non-recursive files can also use %%FILE...% variables.

For example, use a script including something like this:
/ANCHOR
%%FILEdescription.txt%


...with a description.txt file in the folder(s) of interest that includes html code, such as:
</td></tr>
<tr><td colspan="99" div align="center">...This text describes the folder...


A generic setup is included in the file "recursive with descriptions.ini", which can be loaded with F8.  The dirhtml program and help folders include sample definition files.