Announcing: a simple pre-processor to help with FAQ maintenance

---------

Dan Wallach (dwallach@CS.Princeton.EDU)
Wed, 30 Nov 94 05:33:33 -0500


I just finished seriously revamping my FAQ in HTML, and used lynx to
convert to ASCII for posting. To make all the headers and minor
differences between them manageable, I developed this tool.

Feel free to play with it and let me know what you think!

Dan

simple-pp, version 1.0
Dan Wallach <dwallach@cs.princeton.edu>

This file is also available as hypertext
http://www.cs.princeton.edu/grad/dwallach/simple-pp

The distribution can be reached via anonymous ftp
ftp://ftp.cs.princeton.edu/pub/people/dwallach/simple-pp-1.0.tar.gz


simple-pp combines some features of cpp and NoWeb, without generating
extraneous #line tags and other junk that clutter the output of cpp
and such.

(yes, those #line directives are useful for a compiler / debugger, but
they're not useful for an FAQ posting)
_________________________________________________________________

To see how I use simple-pp, check out "sample.xhtml". When you run
make, it will create "sample" and "sample.html", in about the same
way I create my Typing Injury FAQ.
_________________________________________________________________

COMMAND LINE OPTIONS:

simple-pp [-escape char] [-define ... ] ... [-output file] [input1]
[input2] ...

-escape character
Changes the "escape" character for simple-pp (default is "#")

-define symbol OR -define symbol=value
Defines a new macro

-output filename
Changes the file output (default is standard output)

BUILT-IN STATEMENTS:

#ifdef symbol
tests if symbol has been defined, and disables output if it's
undefined

#ifndef symbol
tests if symbol has not been defined, and disables output if
it's defined

#if expression
treats expression as a Perl expression (passing it to eval) and
disabling output if the expression is false

#else and #endif
work just like cpp's statements -- you can safely build nested
if/else/endif statements, and it will work fine

#include file
replaces the current line with the contents of file, continuing
macro processing on the file

#define macro OR #define macro value
defines the macro to either exist, or exist with a given value

#undefine macro
undefines the macro

#output filename OR #output -
changes the output file of simple-pp to filename
The special filename "-" maps to either stdout or the value
passed to the -output command line argument

##
if you put multiple escape characters together, the line is
taken to be a comment, and is removed

PRE-DEFINED MACROS:

_line_
line number in the current input file

_file_
current input file name

_level_
recursion level of #include statements (it starts at 1, then
increases)



Macros are used by typing #MACRO_NAME# which is then replaced by the
value of the macro.

--
Dan Wallach    //    dwallach@cs.princeton.edu    //    Phone#: 609-683-4673
http://www.cs.princeton.edu/grad/dwallach/


[ Usenet Hypertext FAQ Archive | Search Mail Archive | Authors | Usenet ]
[ 1993 | 1994 | 1995 | 1996 | 1997 ]

---------

faq-admin@landfield.com

© Copyright The Landfield Group, 1997
All rights reserved