| THE META-HTML LANGUAGE REFERENCE MANUAL

Block Commands | [TOC] | File Operators

## Section Intro: Page Operators

Synopsis:

Meta-HTML contains a few commands which operate on the entire page as it currently exists.

You may find, modify, or delete text which has already been looked at by the interpreter, as well as text which hasn't yet been looked at.

Most of the time, you won't need to use such commands. They can make it hard for other people to understand the sequence of code in your page, and they can sometimes produce unexpected results which are difficult to debug because much of the information has been modified.

Commands:

cleanup-whitespace page-insert | page-search replace-page | subst-in-page

Variables:

mhtml::epilogue-document |  |  |

### Function Documentation

`<cleanup-whitespace>` | Simple

Reduces the amount of whitespace in the output page to the minimum required. This function carefully avoids the contents of `<pre> ... </pre>` constructs, as well as any material appearing in a `<textarea ...> ... </textarea>` construct.

Placed as the last instruction on a page, it is an effective way to reduce the amount of data sent back over the network to the connecting browser.

`<page-insert OFFSET CONTENT>` | Simple

Insert CONTENT directly into the current page at the offset specified by OFFSET.

In most cases, there is never any need to do this. For some very strange situations involving direct communication with both the Web server, and the connecting client, it is conceivably possible that you would use this command.

But I doubt it.

`<page-search START-OFFSET REGEX [END]>` | Simple

Returns a number representing the number of characters from the start of the current page that REGEX appears. If START-OFFSET is not zero, then the search starts from that many characters from the beginning of the page.

The optional argument END says to return the position of the last character which matched REGEX, instead of the first.

Why would you use this?

`<replace-page FILENAME [ALT=CODE]>` | Simple

Replace the entire contents of the current page with the contents of the file named by FILENAME. You probably don't want to use this command, use `redirect` instead. In that way, the URLs give a consistent view to the user. The rules for which file is chosen are identical to those for `include`.

`<subst-in-page THIS WITH-THAT>` | Simple

Replaces all occurrences of THIS with WITH-THAT in the current page. Both THIS and WITH-THAT are evaluated before the replacement is done. THIS can be any regular expression allowed by the POSIX extended regular expression matching.

This command can be useful when included as part of a footer `include` file. For example, you could replace all occurrences of `%name%` with a the value of the variable `FirstName` by writing:

      <subst-in-page %name% <get-var forms::FirstName>>

Edit Section
Function Index
Variable Index

The META-HTML Reference Manual V1.4 Copyright © 1995, 1996, Brian J. Fox, 1996, 1997 Universal Access Inc.
Found a bug? Send mail to bug-manual@metahtml.com