ANNOUNCE: PageTemplate 0.3.1


(Brian Wisti) #1

Hi All,

I finally had enough time away from job stuff to add things to
PageTemplate (seems I’m always griping about too much or not enough
work). The visible changes are small, but the supporting framework has
undergone some major changes to simplify testing and keep my poor
little brain from melting when I look at the code.

I think now it’s time to put together a nice assortment of sample apps
and see how well this thing performs in the real world.

Here’s the download page:
http://sourceforge.net/project/showfiles.php?group_id=53220

… and here’s the documentation page:
http://www.coolnamehere.com/geekery/ruby/pagetemplate/

Okay, folks. Have fun with it!

Brian Wisti

CHANGES FROM 0.2.0

···
  • It works under ruby 1.6 now!
  • Experimental support for caching template information to disk.

PageTemplate.rb

Use PageTemplate.rb to create output based on template pages and the
code of your program. This package is inspired by Sam Tregar’s
HTML::Template package for Perl. Its main intent is to separate design
and code for CGI programs, but it could be useful in other contexts as
well (Ex: site generation packages).

PageTemplate.rb is distributed under the MIT License.

As a side note: if you are using PageTemplate in your projects, or add
features to your copy, I’d love to hear about it.
Brian Wisti (brian@coolnamehere.com)
http://www.coolnamehere.com/geekery/ruby/pagetemplate/

Features

  • Variable substitution
  • If and If/Else structures
  • Loops and Loop/Else structures
  • Customizable Syntax
  • Caching template information for improved performance

(Sean O'Dell) #2

Brian Wisti wrote:

Hi All,

I finally had enough time away from job stuff to add things to
PageTemplate (seems I’m always griping about too much or not enough
work). The visible changes are small, but the supporting framework has
undergone some major changes to simplify testing and keep my poor little
brain from melting when I look at the code.

I think now it’s time to put together a nice assortment of sample apps
and see how well this thing performs in the real world.

Here’s the download page:
http://sourceforge.net/project/showfiles.php?group_id=53220

… and here’s the documentation page:
http://www.coolnamehere.com/geekery/ruby/pagetemplate/

Okay, folks. Have fun with it!

Brian Wisti

CHANGES FROM 0.2.0

  • It works under ruby 1.6 now!
  • Experimental support for caching template information to disk.

PageTemplate.rb

Use PageTemplate.rb to create output based on template pages and the
code of your program. This package is inspired by Sam Tregar’s
HTML::Template package for Perl. Its main intent is to separate design
and code for CGI programs, but it could be useful in other contexts as
well (Ex: site generation packages).

PageTemplate.rb is distributed under the MIT License.

As a side note: if you are using PageTemplate in your projects, or add
features to your copy, I’d love to hear about it. Brian Wisti
(brian@coolnamehere.com)
http://www.coolnamehere.com/geekery/ruby/pagetemplate/

Features

  • Variable substitution
  • If and If/Else structures
  • Loops and Loop/Else structures
  • Customizable Syntax
  • Caching template information for improved performance

Awesome Brian, love this PageTemplate library. =) I’m making massive
use of it across like 10 different web sites right now.

Sean

(Patrick Roemer) #3

Hi,

Brian Wisti wrote:

I finally had enough time away from job stuff to add things to
PageTemplate (seems I’m always griping about too much or not enough
work).

I’m just trying it out and it looks really nice and simple.

Just one proposal for a small fix: It complains about 'var’
directives with variable names containing keywords, i.e.
[%var articleno%] yields a ‘loop branch without corresponding
opening directive’ because of the ‘no’ suffix. Enclosing the
default glossary regexps in ‘^…$’ seems to fix this.

I’d like to include something like a bounded loop such as
[%in images(0,4)%]. Are there any plans on your side to
enable additional parameters in commands as in the above
sketch?

Regards,
Patrick


(Evan Martin) #4

Link from “programmer’s perspective” page to "designer’s perspective"
page is broken.

(Also, due to what is I assume some CSS layout, if the page is too wide
Internet Explorer doesn’t display a scrollbar and just shows the right
side of the page. I had to stretch my browser out to the left to be
able to read it…
Man, I hate web design. :P)

···

On Sat, Jun 08, 2002 at 01:36:27AM +0900, Sean O’Dell wrote:

http://www.coolnamehere.com/geekery/ruby/pagetemplate/


Evan Martin
martine@cs.washington.edu
http://neugierig.org


(Brian Wisti) #5

Wow. Somebody’s actually using it? Thanks, it’s a nice pat on the
back. Let me know if you have any issues (or links you want to share)!

Later,
Brian

···

On 2002.06.07 09:36 Sean O’Dell wrote:

Awesome Brian, love this PageTemplate library. =) I’m making
massive use of it across like 10 different web sites right now.

Sean


(Brian Wisti) #6

Hi,

Just one proposal for a small fix: It complains about 'var’
directives with variable names containing keywords, i.e.
[%var articleno%] yields a ‘loop branch without corresponding
opening directive’ because of the ‘no’ suffix. Enclosing the
default glossary regexps in ‘^…$’ seems to fix this.

Thanks for finding and fixing! The error you describe has been added
as part of the standard test run, and a variation of your fix (the same
plus allow whitespace on either side) has been applied in the code. An
updated PageTemplate will be available sometime in the next hour - I’m
still getting the hang of Sourceforge :wink:

I’d like to include something like a bounded loop such as
[%in images(0,4)%]. Are there any plans on your side to
enable additional parameters in commands as in the above
sketch?

MY plan is to keep the syntax as simple as possible, but providing
access to an object’s public interface made that goal more difficult.
As soon as I figure out how to hide the complexity from your local Web
designer, I will definitely provide some means of passing
parameters. Then you could find or make a way to do bounded loops, yes.

It’s something to look forward to, I hope :slight_smile:

Later,
Brian Wisti
brian@coolnamehere.com

···

On 2002.06.08 06:57 Patrick Roemer wrote:


(Brian Wisti) #7

Argh … so much for CSS saving us all from browser issues. I’m using
Linux, and haven’t been able to duplicate the layout issue under Opera,
Konqueror, or Mozilla. I’ll poke around a bit and see if there’s
anything I can do with that.

As far as the bad link, all I can say is … “D’Oh.” It’s fixed now.
Thanks for letting me know!

Later,
Brian

···

On 2002.06.07 10:11 Evan Martin wrote:

On Sat, Jun 08, 2002 at 01:36:27AM +0900, Sean O’Dell wrote:

http://www.coolnamehere.com/geekery/ruby/pagetemplate/

Link from “programmer’s perspective” page to "designer’s perspective"
page is broken.

(Also, due to what is I assume some CSS layout, if the page is too
wide
Internet Explorer doesn’t display a scrollbar and just shows the
right
side of the page. I had to stretch my browser out to the left to be
able to read it…
Man, I hate web design. :P)


(Rick Bradley) #8

(Also, due to what is I assume some CSS layout, if the page is too wide
Internet Explorer doesn’t display a scrollbar and just shows the right
side of the page. I had to stretch my browser out to the left to be
able to read it…

That wouldn’t happen to be an IE 5.* browser on a Mac would it?

I’ve seen the same thing on that browser (with no other browsers
exhibiting the behavior) when a float: CSS attribute is used. IE5 on
Mac is broken in this regard (and apparently other CSS-related regards).
Note that the IE code base for the Mac is independent from the IE code
base for Windows.

If you’re not using that browser then maybe we can come up with a
different hypothesis :wink:

Rick

···


http://www.rickbradley.com MUPRN: 173 (89F/96F)
> runs well; and Nicole
random email haiku | is keeping her daughter out
> of the Pontiac.


(Evan Martin) #9

(To the list: sorry, I intended to make my initial response off-list,
but this list sets the Reply-To and I’m not used to that.

Now I’m continuing the response on-list because a question was asked of
me directly.

See also:
``Reply-To’’ Munging Considered Harmful
http://www.unicom.com/pw/reply-to-harmful.html )

···

On Sat, Jun 08, 2002 at 02:42:52AM +0900, Rick Bradley wrote:

(Also, due to what is I assume some CSS layout, if the page is too wide
Internet Explorer doesn’t display a scrollbar and just shows the right
side of the page. I had to stretch my browser out to the left to be
able to read it…

That wouldn’t happen to be an IE 5.* browser on a Mac would it?

That was with IE 5 or so on Windows 2000.

(I usually leave my Windows machine off but I had an assignment that
requried Windows and the browser was handy…)


Evan Martin
martine@cs.washington.edu
http://neugierig.org


(Rick Bradley) #10

See also:
``Reply-To’’ Munging Considered Harmful
http://www.unicom.com/pw/reply-to-harmful.html )

See also:
``Reply-To Munging Considered Useful’'
http://www.metasystema.org/essays/reply-to-useful.mhtml

That wouldn’t happen to be an IE 5.* browser on a Mac would it?

That was with IE 5 or so on Windows 2000.

Different issue then.

Rick

···


http://www.rickbradley.com MUPRN: 547 (88F/95F)
> I woke up from it.
random email haiku | I was really hoping that
> I’d forget this one…