PIKT

Samples: HTML Font Size Macros

PIKT Logo
Home FAQ News Intro Samples Tutorial Reference Software Authors Licensing SiteSearch

Computer Magazines at Amazon.com

Linux Magazine
Linux Magazine

Information Systems Security
Information Systems Security

Security Administrator
Security Administrator

Information Security Technical Report
Information Security Technical Report

Journal Of Network And Computer Applications
Journal Of Network And Computer Applications

The macros in this selected portion of the sample html_macros.cfg configuration file below are used for HTML formatting of font sizes.

///////////////////////////////////////////////////////////////////////////////
//
// html_macros.cfg -- macros for html formatting
//
///////////////////////////////////////////////////////////////////////////////

...

// font sizes

h1(T)		<h1>(T)</h1>
h2(T)		<h2>(T)</h2>
h3(T)		<h3>(T)</h3>
h4(T)		<h4>(T)</h4>
h5(T)		<h5>(T)</h5>

fs(S, T)	<font size="(S)">(T)</font>

f1(T)		=fs(1, (T))
f2(T)		=fs(2, (T))
f3(T)		=fs(3, (T))
f4(T)		=fs(4, (T))
f5(T)		=fs(5, (T))
f6(T)		=fs(6, (T))

fi1(T)		=fs(+1, (T))
fd1(T)		=fs(-1, (T))

...

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
Using macros such as these, we can dispense for the most part with ugly, error-prone HTML tags and instead use the much shorter and more readable PIKT macro equivalents.

So, for example, instead of writing this:
<font size="1" color="#808080">192,643 site visitors since 2001-11-05.</font>
we would write this (using the =f1() macro in addition to several other macros):
=f1(=fgry(=visits_pikt site visitors since =date_first_log_entry_pikt.))
both of which would result in:

192,643 site visitors since 2001-11-05.

but doing it the second way with PIKT macros is clearer (also more convenient, since we automate adjustments in the =visits_pikt count).

Here is some HTML code from the current page that uses the font size macros:
[=fd1(For more examples, see =lnk(Samples, =piktdocroot/samples/samples.html).)]
With similar HTML preprocessing, the principal PIKT Maintainer manages more than 650 web pages (at last count) over several different Web sites (including pikt.org, as you might expect).

[For more examples, see Samples.]

Home | FAQ | News | Intro | Samples | Tutorial | Reference | Software | Authors | Licensing | SiteSearch
Links | SiteIndex | Pikt-Users | Pikt-Workers | Contribute | ContactUs | Top of Page
Page best viewed at 1024x768.   Page last updated 2005-06-22.
This site is PIKT® powered.
PIKT® is a registered trademark of the University of Chicago.
Copyright © 1998-2005 Robert Osterlund.  All rights reserved.

Computer Books at Amazon.com

HTML 4 for Dummies
HTML 4 for Dummies

HTML & XHTML: The Complete Reference
HTML & XHTML: The Complete Reference

Dynamic HTML: The Definitive Reference
Dynamic HTML: The Definitive Reference

Web Performance Tuning
Web Performance Tuning

The Web Programming CD Bookshelf
The Web Programming CD Bookshelf