Re: How many versions...

---------

Rik Harris (rik@rdt.monash.edu.au)
Thu, 27 Jan 94 14:08:55 +1100


Marcelo Gallardo <marcelo%marcelo.remote@Princeton.EDU> wrote:

> I'm kind of curious as to how many "versions" of the FAQ's
> people are updating.
>
> I'm currently keeping two versions. One is ASCII, the second
> HTML. I made additions and modifications to the ASCII version
> and then "cut n paste" the changes to the HTML version. The
> reason I'm doing it this way is because I started the FAQ in
> ASCII, and just recently converted it to HTML to see what it
> would look like. I like the HTMLed version, but I also happen to
> like the ASCII version since I put so much work into it.

Some of mine are HTML, and automatically converted to ASCII with the
line-mode browser (www). Others I mark up in my own custom format and
convert, with programs I have written myself, to several formats. I do
all of this on-the-fly with my posting script (which is a preprocessor
to jik's post_faq).

I've never liked maintaining any information in more than one place.
Luckily I have the means to avoid doing this (ie some programming
skills). You can actually achieve quite a lot cpp, m4, perl and friends.

For example, to convert an HTML file to ASCII:

cat file.html | www - -na > file.ascii

Or using CPP (I don't do it quite this way myself, I'm just trying to
illustrate a point):

words words words words
#ifdef HTML
<tags>other words<other tags> etc
#else
more words words words
#endif
still more words words words words

To convert the above file to HTML and ASCII:

cat file | cpp -P -DHTML > file.html
cat file | cpp -P > file.ascii

Or, you can do something a little more general (I don't do it this way
either, but I have in the past):

divert(-1)
dnl
dnl Initial definitions
dnl
ifdef(`HTML', `
define(`STRONG', `<strong>$1</strong>')
define(`EM', `<em>$1</em>')
define(`LINK',`<A HREF="$2">$1</A>')')
ifdef(`ASCII', `
define(`STRONG', `$1')
define(`EM', `$1')
define(`LINK', `$1 (in WWW, use $2)')')dnl
divert(0)dnl
dnl
dnl HTML header stuff
dnl
ifdef(`HTML',`<HEAD><TITLE>Test for m4</TITLE></HEAD><BODY>')dnl
dnl
dnl actual document
dnl
Here's a STRONG(bold) word, and an EM(emphasised) word. Or you can
LINK(link, http://blah/blah/blah) to other places.
dnl
dnl HTML footer stuff
dnl
ifdef(`HTML',`</BODY>')dnl

To convert the above file to HTML and ASCII:

m4 -DHTML file.m4 > file.html
m4 -DASCII file.m4 > file.ascii

Once you get the top parts sorted out, the text is fairly easy to mark
up as you go. Of course these are just examples, and more formats
than this can get complicated, but for a large document, you want to
reduce your ongoing work as much as possible. M4 can be annoying
sometimes, though, as words like 'index' in the middle of your text
tend to be deleted, unless you do an undef(`index').

I'm happy to chat to people about this sort of stuff.

rik.

--
Rik Harris - rik.harris@vifp.monash.edu.au              || Systems Programmer
+61 3 560-3265 (AH) +61 3 90-53227 (BH)                 || and Administrator
Fac. of Computing & Info.Tech., Monash Uni, Australia   || Vic. Institute of
http://www.vifp.monash.edu.au/people/rik.html           || Forensic Pathology


[ 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