phmap Overview

phmap is a Bourne shell script for generating gophermap files from
the contents of a gopher server file system subtree.

(Thinking about renaming script "tirph" and making part of revived
TIR project.)

* Gophermap Layout

|--------------------|
| TITLE              |
|--------------------|
| DESCRIPTION        |
|--------------------|
| NEXUS LINK         |
|--------------------|
| GOPHER HEADER      |
|--------------------|
| PHLOG              |
|--------------------|
| DIRECTORY CONTENTS |
|--------------------|
| EXITS              |
|--------------------|
| NEXUS LINK         |
|--------------------|
| GOPHER FOOTER      |
|--------------------|
| NEXUS LINK         |
|--------------------|
| FORTUNE            |
|--------------------|

* Section Contents

** TITLE

Node title. Contents of file .title in target
directory. Optional. Usually in form "<directory> - <one-liner>".


** DESCRIPTION

Node description. Contents of file .description in target
directory. Optional.

** NEXUS LINK

Link to nexus directory (gopherhole root). Inserted at top and bottom
of non-nexus nodes.

** GOPHER HEADER

Gopher-specific information and links. Contents of file .gophhead in
target directory. Optional.

** PHLOG

Reverse chronological list of links to N most recently added or
changed files. Link text format:

 <ls-timestamp> <document-title> [<directory>]

** DIRECTORY CONTENTS

List of gopher links to files and subdirectories of current
directory. Link text is document/subdirectory title.

** EXITS

List of gopher links to related topic directories generated from
directory name list in file .exits. Link text is directory title.

** GOPHER FOOTER

Gopher-specific information and links. Contents of file .gophfoot in
target directory. Optional.

** FORTUNE

Random fortune. Generated by fortune program (if available).

* Issues

1. Phlog entry selectors should be portable, valid regardless of
  where gophermap file is stored.

* Notes

** Titles of Documents and Subdirectories

*** Plain text files

(Extensions: *.txt, *.org)

First line of file.

*** HTML files

(Extensions: *.html, *.htm, *.shtml)

Contents (first line if multi-lined) of first H! tag.

*** Subdirectories

Contents of .title file in subdirectory or subdirectory name if no
title file exists.