From: "C. Chad Wallace" <[email protected]> At 8:13 PM on 27 Nov 2009, Octavian Râsnita wrote:
> From: "C. Chad Wallace" <[email protected]> > > At 8:45 AM on 26 Nov 2009, Randal L. Schwartz wrote: > > > >>>>> "Octavian" == Octavian Râsnita <[email protected]> writes: > > > > Octavian> but if I put just simple html code in the database > > > > ... then your successor will submit your code to thedailywtf.com > > > > ... and we'll all have a good laugh at your expense. > > > > Seriously, wrong way to do it. > > I agree with Randal, wholeheartedly. You need to maintain a > separation between data (in the database) and HTML (in your > templates). They should not be mixed. > > What happens when, for instance, you change your templates to XML > rather than HTML? Or you want to present the same data as a PDF? > It's going to have HTML in it! > > > Well, as I said, I also agree, but I couldn't find that recommended > way. Can you tell me the solution for storing complex documents that > include text, lists, tables, headings which doesn't use HTML? I use BBCode for that. There is a Template plugin for BBCode, and there are Perl modules (e.g., Parse::BBCode) that convert from BBCode to other formats. However, Markdown or Textile might work, too... They let you write your formatting in plain text, and then translate it up to HTML or whatever you want. Ok, thank you. I will compare BBCode, Markdown and Textile and see which of them would be the best for what I need. PS. Sorry for not responding to the list in my previous message. If I wrote you privately only, I've done it by mistake. Octavian _______________________________________________ templates mailing list [email protected] http://mail.template-toolkit.org/mailman/listinfo/templates
