Storytelling Games



IMnews2html v1.0

Name

IMnews2html - Convert a MUSH2.2 type news.txt file into a set of HTML files

Synopsis

[perl] IMnews2html [newsfiles]

Availability

From <IMnews2html>.

Description

IMnews2html accepts the standard input, or named file(s) as a MUSH 2.2 style news.txt file. (MUSH 2.2 is one of a family of programs that are similar to the text-only adventures of the early 80s, except that they allow multiple users and are easily customisable.) Each entry in the newsfile is used to produce one HTML format file in the current directory with hypertext links to other entries where their names appear in the text. Entry names that end in numbers are assumed to be entries that are cut into sections, and concatenated.

The format of the HTML file is chosen to be readable and preserve as much of the original news entry as possible. The heading is taken from the '&' line. The text is placed within <pre> markers so that formatting is preserved. The footer contains a link to the first news entry, & Help, and a generation date. HTML 2.0 markers make the page black on a white background with red/purple new/old links respectively.

Users may want to edit the newsfile slightly before they run IMnews2html. '&' lines are now displayed, so should be capitalised. Entry names are only recognised if they match the entire entry name, and are not part of larger words or next to square or angular brackets, whereas MUSH 2.2 would recognise only enough of the entry name to be unique. 'news apps <name>, where <name> is one of 'scientist', 'unit', or 'monster'' will no longer work. There is, of course, no guarantee that links will be in-context: the sentence 'One set of soldiers go this way' could produce a link to the entry on Egyptian God/Osirian Criminal/Go'uld System Lord 'Set'.

Examples

You might turn the MUSH 2.2 default news file into WWW pages with:
perl IMnews2html ~/mush/text/news.txt
It would produce a 'help.html' file thus:

help

Welcome to TinyMUSH 2.2's default news file.
 
Here is some information which you might find useful:

Code            (last updated 1/9/95)
Patchlevel      (last updated 3/22/95)
Writing News    (last updated 1/7/95)

Type 'news <topic name>' for more information about a given topic.
 
[News Help]
Generated Fri Oct 6 0:36:29 BST 1995 by IMnews2html.prl v1.0 by Ian McDonald <type40@tardis.ed.ac.uk>
Generating even the default news file trips over some common problems:
  • Because the '&' line is not capitalised, the title of the first page isn't either.
  • Because '& patchlevel 2.2.0' ends in a digit, it is assumed to be a continuation to 'news patchlevel' and appended to it.
  • There are no links to 'news patchlevel 2.2.0', 'news patchlevel 2.2.0 features', and 'news patchlevel 2.2.0 functions'

Files

This requires perl, at least version 4, and ctime.pl from the standard perl library. If you don't have perl, you should get it anyway.

See Also

MUSH, WWW

Bugs

I don't know any. At the moment. Let me know about anything else that goes wrong :). Naturally, the things mentioned above are features, not bugs :).

Feedback

I've done this as a no-frills program, over a day or two. If this gets wide interest and use, then I'll put more energy into frilling it up, letting people customise the headers and footers (the Perl script is commented to make doing this easier), the destination directory, and suchlike. So if you use it or have any comments, please let me know.
Ian McDonald <type40@tardis.ed.ac.uk>
Last modified: Mon Oct 9 00:58:10 1995 , edited to fit into site and fix links Mon May 29 2006