How to use StrpHTML.

Now also included in the archive: KeepHTML!. Similar to StrpHTML, but with a different approach. Read more about it here.

WARNING! StrpHTML has been completely rewritten! Commands have changed. If you have used StrpHTML with a version number less then 1.2 you'll have to update the StrpHTML statements in your html files... Sorry, had to be done. The good news is that it's now more flexible then ever. In fact, it is so good now, you'll be sorry that you can't pay for it!

StrpHTML is a program I wrote to make it easier to maintain one of my web-pages. That page actually consists of two pages, that are almost identical. The only difference is that one page has background music, while the other does not. So, everytime I updated the page, I had to copy it to the no-music version, and manually remove the music code and adjust the link code.

Now, with StrpHTML, I put a couple of comment statements around the code that should be removed, and run a batchfile to create the no-music page. Like this:

<!--CUT1-->
<U>[Music]</U> <A HREF="indexnm.html">[No Music]</A>
<EMBED src="myprettymelody.mid" AUTOSTART="TRUE" HIDDEN="TRUE">
<!--ENDCUT1-->

<!--REMOVE1
<A HREF="index.html">[Music]</A> <U>[No Music]</U>
1REMOVE-->


As you can see, the two REMOVE statements effectively comment out the no-music code. Before StrpHTML starts chewing, the code results in this:

Blah blah....
[Music] [No Music]
(You hear beautiful music)
Even more blah...

And when StrpHTML is finished, the code results in this:

Blah blah....
[Music] [No Music]
(Silence!)
Even more blah...


As of version 1.2 of StrpHTML there is a lot more possible. With the new strip-level approach, you could write a masterpage, and have StrpHTML create several different subpages from that page. It is possible to get an effect that is similar to using frames. For example, let's make a masterpage:

<H1> This is my header, it 's the same on every subpage.</H1>
<A HREF="index.htm">Index</A>
<A HREF="bookm.htm">Bookmarks</A>
<A HREF="catporn.htm">Nude Cats</A>
<A HREF="tweety.htm">Tweety</A>
<HR> <!-- a horizontal line to separate mainpage from subpages -->

<!--CUT0-->
This page contains my bookmarks.
<a href="http://noord.bart.nl/~arjenv/strphtml.html">Great!<a> <!--ENDCUT0-->

<!--CUT1-->
This page has some nude pictures of our cat.
[SORRY! CENSORED] <!--ENDCUT1-->

<!--CUT2-->
This page is dedicated to Tweety and Sylvester.
Watch the Cartoon Channel for more Tweety! <!--ENDCUT2-->

Now use the following batchfile...:

StrpHTML master.htm index.htm 0 1 2
StrpHTML master.htm bookm.htm 1 2
StrpHTML master.htm catporn.htm 0 2
StrpHTML master.htm tweety.htm 0 1

...and you have an indexpage, a bookmark page, a cat page and a tweety page, all with the same header.


This program is free!. It was also created quick and dirty, so don't complain if it doesn't work like you want it to. It works for me, and that's it. Still interested? Okay then, come and get it!

I'll give the sourcecode to anyone who will update this program to use Win95 long filenames. Just send < A HREF="mailto:arjenv@worldaccess.nl">me an email with the subject "send strphtml source" (exactly like that, but without the quotes), and don't forget to send me a copy of the updated source :-). Right now, you will just have to work around that problem. Here is how I do that:

Copyhtml.bat:

@echo off
del indexnm.html
strphtml index~1.htm indexnm.htm 1
ren indexnm.htm indexnm.html


KeepHTML.

Sorry, not as much documentation for this one, but if you can use StrpHTML, this program will be easy to use. The biggest difference is that KeepHTML keeps lines from HTML files. Well, that's a surprise, isn't it? :-) Moreover, KeepHTML works with a maximum of 999 levels instead of 10 in StrpHTML. The zipfile includes an example that uses both programs. Here's the helpscreen:

KeepHTML  V1.3 Strips lines from HTML files.
          Donated to the public domain by A. Venhuis, 1997

Syntax:   KeepHTML  infile outfile [n  ] 

infile:   The html file to read from.
outfile:  The html file to write to. If it exists its contents will be lost.
n:        A number that tells KeepHTML which lines to keep.

          Strips everything from HTML files that is enclosed between a line
          starting with "<!--KEEP n -->" and a line starting with
          "<!--ENDKEEP n -->". n is a number between 1 and 999.

          It does NOT strip lines between KEEP and ENDKEEP statements, when
          the number in those statements was specified on the commandline.

          Error checking is minimal! Use at your own risk!
/TT>