Use Perl to generate your skeleton? Nonesense. All i do is
create a "skeleton" that describes the layout. I usually
start by lifting a layout from
Box
Lessons. Then i either use HTML::Template or
Template. Here is a quick skeleton that i used
recently with Template-Toolkit:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:/
+/www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="/css/default.css" type="text/css" />
<title>[% title %]</title>
</head>
<body>
<div id="top">
<h1>[% title %]</h1>
</div>
<div id="left">
[% PROCESS widget/menu.html %]
</div>
<div id="middle">
[% content -%]
</div>
<div id="right">
[% PROCESS widget/calendar.html %]
</div>
<div id="bottom">
[% PROCESS widget/footer.html %]
</div>
</body>
</html>
As you can see, the CSS file is completely seperate and not
generated by Perl! Instead, Perl is used
to load this template and substitute, etc. This is, IMHO,
a much better solution as it allows me to hand my HTML to
someone who designs and doesn't code.
So, in conclusion, my experience has been that the more
flexible and useful applications of Perl and CSS are to
simply template the skeleton and let Perl worry about the
data, not the presentation. Otherwise you might as well be
using Tk.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|