The Ming Server
The Ming Server generates web pages statically or dynamically. As a local executable, it generates a static site from a directory tree of simple text files. Installed in cgi-bin, it creates those same pages on demand from the same source files, in response to browser requests. Parsing of different source types and the writing of pages are separated, making it easy to extend The Ming Server to new data types or delivery methods.
This document describes both usages: static and dynamic.
STATIC USAGEming.cgi --debug --force local/src/dir local/dest/dir
DESCRIPTIONThe first time ming.cgi is run, it creates the entire site and writes a time-stamp. Subsequent runs only update files newer than the stamp. See force option. In order to run ming.cgi, you will need:
The site.html plate (see data/site.html in the distribution) uses HTML comment and comment-end tags in column 0 to determine where data goes. The tags "content", "title", and "menu" are automatically generated but need not be in the plate. The Ming Server will use any comment tags in the data and plate. The "content" tag is used extensively as a default. Only "title" does not have an end tag and the formatting of its use as title element cannot be changed. This has to do with how browsers parse titles.
COMMAND-LINE OPTIONS
EXAMPLESSource Files The following are expected. Anything else is ignored. Examples are in the distribution's user/data dir tree.
key file Key files take the following form, beginning with the first line of the file.
file name (no extension) page title (optional descriptive line) (blank line) file name (no extension) page title (optional descriptive line) (blank line) . . . . file name (no extension) page title (optional descriptive line) (blank line) The order of the files in key determine the ordering of the menu, the file used as directory index (first file in key), the page titles, and the text of a "desc" comment tag.
data fileThese have the type on the first line and all following lines are treated as data. The following types are available:
All types are exampled in the user/data tree. site.html The boiler plate for the site is simply an HTML file in the top of the source tree. There is an example site.html in the user/data tree.
NOTES
RETURN VALUES0 good, 1 bad.
http://your.dot.com/cgi-bin/ming.cgi?page=path/to/pageThe Ming Server will generate page at self.DATA/path/to/page
CGI INSTALLATIONThe same python and data files used for static generation can be used to create a dynamically-generated web site. You will need a site with access to Python in the cgi-bin. These simple steps should get you up and running:
WEB LOGThe Ming Server can keep its own log of page requests. Logging is done by the Logger and controlled by PageMaker. The following USER CONSTS should be set in Consts.py:
You can then make the following calls to the log: http://your.dot.com/cgi-bin/ming.cgi?log=logWeb log With Logger.DEMO set to 1. Web log is public http://your.dot.com/cgi-bin/ming.cgi?log=log&view=passwdWeb log displayed privately. PASSWD set in Logger. http://your.dot.com/cgi-bin/ming.cgi?remove=passwd&item=titleWeb log is a Python dictionary and dict[title] will be removed.
NOTES
|