Re: How do you build your HTML?
Chris == Chris Ward [EMAIL PROTECTED] writes: Chris I recommend http://www.template-toolkit.org/. Just print out the Chris documentation so it's on hand and your guarenteed on you way to creating some Chris cool ass stuff. Basically it's embedded perl inside HTMLbut you if you Chris reverse it and call it from within a perl cgi module with apache-mod_perl and Chris you can pre-fetch all the html and necessary data (generated images...etc) Chris requested and cache it all or send it to the browser on the fly...etc. Although I'm using Apache::Template for stonehenge.com, I recently did a project for a Very Large Client using a more traditional MVC paradigm. The CGI (or Apache::Request) code acts as the Controller, selecting Model data and an appropriate View (written in Template Toolkit), passing Model and meta references into the template as parameters. Apache::Template requires discipline to program in this fashion. The first line of your template needs to be something like: [% USE control = My.Controller() %] so that you can call to Perl code as a controller. Otherwise, you write a lot of controller code in TT language, and that's a bad match. I now see this firsthand, having done it both ways. See also OpenInteract, which takes this to the next step. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 [EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/ Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: How do you build your HTML?
Kevin Old wrote: Hi Chris, Well, I already use HTML::Mason as a templating engine and everything is fine. What I need is a way to generate HTML 4.01 compliant HTML. Basically taking the concept of CGI.pm, but keeping the resulting HTML up to date with the HTML specifications. For example, if you use CGI.pm or write a table by hand without the width parameter of the table the HTML validator at w3.org will not validate your HTML. That doesn't really seem to be software problem. Better authoring software would probably just not let you complete the table insertion without this critical specification. It might offer the convenience of a best-guess default, but that is really all it should do, since table width is intrinsically a design decision. I found this out the hard way. For years I wondered why my tables always came out funky in Netscape. Then I relaized that it just wanted that overall parameter before it could crunch the internal dimensions of a table. The tables where I had specified width came out nicely. Better to just give the spec. HTML is very flexible, accepting width as absolute pixels or relative percentages of screen width. I know this is just one example, but if that is indicative of the demands made by 4.1, I'd suggest just going with the flow and learning from the error messages. HTML is still a very approachable language. Just as, with Perl, you keep chipping away at your errors until it compoiles cleanly, working with your HTML till it passes muster will simply add more skills to your toolkit. It may also inform your programming/markup. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
How do you build your HTML?
Hello everyone, I've been hand coding HTML for some time now, but recently a lazy streak has run through me and I'd like to find a way to autogenerate creation of a lot of my HTML. Thing is, I'd also like it to be HTML 4.01 compliant. I'd rather not go the CGI.pm route as I am generating static pieces of HTML for use in HTML::Mason pages. A table here, a link there, and so forth, in the end it seems that I can never catch all the errors for HTML 4.01 compliance. I've tried all the linux HTML editors and none of them come close to what I need. Bluefish for instance even generates some HTML that Mozilla won't even interpret. Thoughts, suggestions? Thanks, Kevin -- Kevin Old [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: How do you build your HTML?
On Dec 15, 2003, at 7:57 AM, Kevin Old wrote: [..] I've been hand coding HTML for some time now, but recently a lazy streak has run through me and I'd like to find a way to autogenerate creation of a lot of my HTML. Thing is, I'd also like it to be HTML 4.01 compliant. I'd rather not go the CGI.pm route as I am generating static pieces of HTML for use in HTML::Mason pages. A table here, a link there, and so forth, in the end it seems that I can never catch all the errors for HTML 4.01 compliance. [..] Kevin, it shoulds like you have mutually conflicting goals here. On the one hand you want to 'automate' a process of creating 'static pages' - hence there are three basic steps: select a template of a basic html page edit the template as a new page post the new page on the web site Now bear with me, this is gonna sound a bit dopey, but it is based upon what I have done, prior to turning over most of this to bbedit. make a directory with the basic pages each is named by what it templates blog.tmpl table.tmpl have your application either take a 'template' name cf Getopts::Long or walk the dirBlock of the template directory with opendir() and readdir() present the list to the user, get the choice back copy the template to say /tmp invoke $EDITOR on it with system() then have it ftp it up to the web-site Or do you want it to also validate that you have not injected brainSillies into the html as well? ciao drieux --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
RE: How do you build your HTML?
Hi Kevin and everyone, I recommend http://www.template-toolkit.org/. Just print out the documentation so it's on hand and your guarenteed on you way to creating some cool ass stuff. Basically it's embedded perl inside HTMLbut you if you reverse it and call it from within a perl cgi module with apache-mod_perl and you can pre-fetch all the html and necessary data (generated images...etc) requested and cache it all or send it to the browser on the fly...etc. Check out www.einsteinspub.com for my only web-project.it's taken about 4 months of hard work to get it this far..but it's awsome IMHO! 100% (well you know what i mean) made by me. Coded in Perl and i use strict; use warnings; use Template; use CGI; use GD; use Image::GD::Thumbnail; as dependencies only other than the mysql backend. All the navigation menus are automatically generated on the fly and cached. Just FYI; hope it's what you were looking for. Otherwisewhat are you looking for exactly? A WYSIWYG or What you see is what you get editor? -Chris On Monday 15 December 2003 10:57, Kevin Old wrote: Hello everyone, I've been hand coding HTML for some time now, but recently a lazy streak has run through me and I'd like to find a way to autogenerate creation of a lot of my HTML. Thing is, I'd also like it to be HTML 4.01 compliant. I'd rather not go the CGI.pm route as I am generating static pieces of HTML for use in HTML::Mason pages. A table here, a link there, and so forth, in the end it seems that I can never catch all the errors for HTML 4.01 compliance. I've tried all the linux HTML editors and none of them come close to what I need. Bluefish for instance even generates some HTML that Mozilla won't even interpret. Thoughts, suggestions? Thanks, Kevin -- Kevin Old [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
RE: How do you build your HTML?
Hi Chris, Well, I already use HTML::Mason as a templating engine and everything is fine. What I need is a way to generate HTML 4.01 compliant HTML. Basically taking the concept of CGI.pm, but keeping the resulting HTML up to date with the HTML specifications. For example, if you use CGI.pm or write a table by hand without the width parameter of the table the HTML validator at w3.org will not validate your HTML. For now, I just run my pages through HTML Tidy (tidy.sf.net) and fix it by hand, but I'd like to take a more proactive approach and fix as many as I can in my initial coding. Oh well, thanks anyway. Kevin On Mon, 2003-12-15 at 13:30, Chris Ward wrote: Hi Kevin and everyone, I recommend http://www.template-toolkit.org/. Just print out the documentation so it's on hand and your guarenteed on you way to creating some cool ass stuff. Basically it's embedded perl inside HTMLbut you if you reverse it and call it from within a perl cgi module with apache-mod_perl and you can pre-fetch all the html and necessary data (generated images...etc) requested and cache it all or send it to the browser on the fly...etc. Check out www.einsteinspub.com for my only web-project.it's taken about 4 months of hard work to get it this far..but it's awsome IMHO! 100% (well you know what i mean) made by me. Coded in Perl and i use strict; use warnings; use Template; use CGI; use GD; use Image::GD::Thumbnail; as dependencies only other than the mysql backend. All the navigation menus are automatically generated on the fly and cached. Just FYI; hope it's what you were looking for. Otherwisewhat are you looking for exactly? A WYSIWYG or What you see is what you get editor? -Chris On Monday 15 December 2003 10:57, Kevin Old wrote: Hello everyone, I've been hand coding HTML for some time now, but recently a lazy streak has run through me and I'd like to find a way to autogenerate creation of a lot of my HTML. Thing is, I'd also like it to be HTML 4.01 compliant. I'd rather not go the CGI.pm route as I am generating static pieces of HTML for use in HTML::Mason pages. A table here, a link there, and so forth, in the end it seems that I can never catch all the errors for HTML 4.01 compliance. I've tried all the linux HTML editors and none of them come close to what I need. Bluefish for instance even generates some HTML that Mozilla won't even interpret. Thoughts, suggestions? Thanks, Kevin -- Kevin Old [EMAIL PROTECTED] -- Kevin Old [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response