;;; sec5.00.mhtml: -*- Meta-HTML -*- 

;;;  Copyright (c) 1996 Universal Access Inc.
;;;  Author: Henry Minsky (hqm@ua.com) Sun Sep 15 11:05:52 1996.
;;; MetaHTML: Examples
<set-var title="Defining Your Own Meta-HTML Tags">
<include header.mhtml>

<plain-text>
  <pagelist-control-panel>

  <h2> Example Of A User-Defined Macro </h2>

  If you find yourself using the same HTML constructs
  over and over again, you can define your own <meta-html>
  macro as a compact way to get the same functionality.

  For example, let's say you wanted to have a tag
  which puts some example text in big italics, on the
  right side of the page, with double quotes around it.

  You might write some HTML that looks like this

  <example-table>
  <table align=right width=50%>
    <tr>
      <td>
	<font size=+1>
	<i>
	``It's easy and fun to
	create new tags in <meta-html>. 
	And it only takes moments!''
	</i>
	</font>
      </td>
    </tr>
  </table>
  <br clear=left>
  </example-table>



  In order to get an effect like this:

  <big-sample 50%>
  It's easy and fun to create new tags in <meta-html>. And it only
  takes moments!
  </big-sample>


  <hr>

  Now with regular HTML, each time you want to use this layout style,
  you would have to write all that HTML over again. And then, if you
  wanted to change the formatting, you would have to go all through your
  HTML pages finding and changing the layout. Not much fun.

  However, if we define a <meta-html> macro, then we only need define
  this layout once. Let's define a new tag called
  <code>BLURB</code>:

  <example-table>
  <defmacro blurb>
    <table align=right width=50%>
      <tr>
	<td>
	  <font size=+1>
	  <i>
	  ``%body''
	  </i>
	  </font>
	</td>
      </tr>
    </table>
    <br clear>
  </defmacro>
  </example-table>

  Now we can use the new <code>&lt;blurb&gt;</code> tag anyplace in our
  web pages, and it will do all the work for us. Let's say we want a
  blurb below which says 
  <blockquote>"Writing <meta-html> macros is as easy as
  writing HTML.  It's just that simple!"
  </blockquote>

  You would simply use the new <code>&lt;blurb&gt;</code> tag
  as shown below:

  <example-table>
  <blurb>
  Writing <meta-html> macros is
  as easy as writing HTML. 
  It's just that simple!
  </blurb>
  </example-table>

  <center> ...which places the following in your HTML document...</center>

  <big-sample 50%>
  Writing <meta-html> macros is as
  easy as writing HTML. 
  It's just that simple!
  </big-sample>

  <br clear>
  <p>

  Using the <code>&lt;blurb&gt;</code> macro, the blurb magically
  appears in the final document, wherever we put a call to it. For
  consistent HTML layout, there's no fuss, no muss. Just define a single
  new <meta-html> tag to produce any HTML code you like.

  <br 5>

  <pagelist-control-panel>
</plain-text>
<include footer.mhtml>