Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions
 Discussion Forums
 HTML, XML, JavaScript...
 Software Reviews
 Editors,Others...
 Top100
 JavaScript Tutorials, ...
 Tutorials
 ASP, CSS, Databases...
 Discussion List
 FAQ, Roundup, Configure ...
 Authoring
 HTML, JavaScript, CSS...
 Design
 Layout, Navigation,...
 Graphics
 Tools, Colors, Images...
 Software
 Browsers, Editors, XML...
 Internet
 Domains, E-Commerce, ...
 WDVL Resources
  Intermdiate, Tutorials,...
 WDVL
 Discussion Lists, Top 100,...
 Technology Jobs

 
Search
 



WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us
Online Shopping
Corporate Gifts
Promotional Golf
Hurricane Shutters
Dental Insurance
PDA Phones & Cases
Career Education
Domain registration
Server Racks
Promote Your Website
Cell Phones
Shop
Rackmount LCD Monitor
KVM Switches

Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Requirements and Test Management kit
For effective test automation IBM Rational offers a team-based, test management solution set that includes requirements, test management and change management for streamlined test planning, test execution, and results analysis. In this kit you will find demos and articles on Rational requirements and test management tools and best practices. » Use Rational's Change and Release Management Solution in Your IDE
This demonstration illustrates how Rational® ClearCase®, ClearQuest® and Build Forge® can be used to help developers develop, build, and test their applications in the comfort of their IDE. » Using IBM Rational Tester for SOA Quality: Testing SOAP Secured Web Services
Learn how to test SOAP-secured Web services by using the IBM Rational Tester for SOA quality. » IBM Rational Testing Ekits
Access five complimentary kits for testers, developers and business domain experts. Each kit provides a collection of materials that can help you understand and use IBM Rational testing tools and best practices. »
Top 10 Articles
  1. Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions
  2. JavaScript Tutorial for Programmers
  3. Design
  4. JavaScript Tutorial for Programmers - Objects
  5. JavaScript Tutorial for Programmers - JavaScript Grammar
  6. JavaScript Tutorial for Programmers - Versions of JavaScript
  7. Cascading Style Sheets
  8. JavaScript Tutorial for Programmers - Embedding JavaScript
  9. JavaScript Tutorial for Programmers - Functions
  10. Authoring JavaScript
Domain Name Lookup
Search to find the availability of a domain name. Just enter the complete domain name with extension (.com, .net, .edu)

suPerlative: The ht Preprocessor

ht is a pre-processor for HTML. It facilitates the maintenance of a large site by abstracting out common 'boilerplate' segments of code, e.g. header and footer segments that are similar system-wide. A number of varying styles and macros can also be supported.

Central to our operations is 'ht', which takes a simplified HTML file and adds 'boilerplate' stuff such as banner ads and navigation menus. ht files start with a header such as:-

Title	:	suPerlative: The ht Preprocessor
Author	:	ALR
Abstract:
	<b>ht</b> is a <em>pre-processor</em> for HTML.
It facilitates the maintenance of a large site by abstracting
out common 'boilerplate' segments of code, e.g. header and
footer segments that are similar system-wide. A number of
varying styles and macros can also be supported.
+++
Content	:
Central to our operations is 'ht', which takes a simplified
HTML file and adds 'boilerplate' stuff such as banner ads
and navigation menus. ht files start with a header 
<a href="HT.ht">such as</a>:-
It's wired with several standard conventions, such as author abbreviations ('AR' for 'Alan Richmond') and table macros, and with styles. There is a main program and several subroutines, e.g. Head and Foot, which are also used by most of our other scripts.

The benefits of using ht are:-

  • Helps enforce consistency and uniform style.
  • Writes valid HTML 4 code for the boilerplate.
  • Enables abbreviation of common constructs, saving time.
  • Facilitates site moves, as when we moved to the Internet.com servers - took much less than a day, which surprised the new owners..
  • Facilitates global changes, e.g copyright year, navigation menus, etc.
  • Figures out where it is, so that navigation uplinks can be appended.
I believe most people think you only have two choices for creating HTML - use an editor or code by hand. But there's a third one which works very well for us: we use a (home-grown) preprocessor. If you like it's a variant of the template method; we have a number of styles built in and can modify them with some parameters. ht is a Perl preprocessor that I wrote for maintaining The WDVL. It allows me to write HTML without having to put on all the 'boilerplate'.

ht generates all the header, table and footer HTML... Using a preprocessor such as ht provides much more flexibility than typical HTML editors (which anyway tend to generate bloated and unreadable code) - for example I can easily change the site style by changing ht and running source files through it.. (very powerful when combined with style sheets).

An ht file looks like this.

You run the file through 'ht' and it sticks on the boilerplate, modified if necessary according to the header parameters and with any macros (abbreviations) expanded. This makes it very easy to create HTML in one of our standard styles, but you can also control the end result as much as you want since the input can contain HTML. And it's also very useful for our mirrors, e.g. there can be small differences automatically introduced such as crediting the host or pointing to CGI programs on the primary site because we don't have CGI access on every mirror. With 1,500 pages to maintain this would hard to do with an editor..

We don't currently use a database but a logical extension of this method would be to put the ht files into a database and then we could generate the pages dynamically, e.g. to account for browser differences. This approach isn't for everyone but anyone who wallows in Perl and HTML should love it..

Finally - ht also allows a small set of abbreviations; e.g.

<center>
	@Prev(Why.html)
	@Up(index.html)
	@Next(Stats.html)
</center>
creates the following links:-

suPerlative: Why Perl Scripting?
suPerlative Web Construction !
suPerlative: Log File Analysers

To use ht, you need:

You would certainly need to edit the subroutines file to change or remove things like the list of author initials, and the navigation menus.


Up to => Home / Software / Perl




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers