Definitions:
- Layout - The underlying structure of a page; how the elements on the page relate to one another.
- Format - The method of displaying a given layout. Examples could include HTML, PDF, XML, CSV, XLS, etc.
- Data - The stuff that is used to populate a given layout so it can be displayed in a given format.
I first asked this question here, without really knowing what I was asking. Now, I have a much better idea of what I'm trying to do.
However, I'm not sure if CPAN has a ready-made solution. I don't think I want a markup-language or template. In fact, I don't think I want any hard-coded values in these layouts at all.
What I want to be able to to do is create one layout for a given report. Then, with:
- The layout
- A format to display it in
- The data to be displayed
I can display it. The reason I think I want to separate layout from format is that PDF requires more info that HTML (i.e., pagebreaks). So, instead of worrying about PDF not having its info, instead put as much info as I can into the layout and translators use what they want. So, HTML can ignore pagebreaks and CSV can ignore nearly everything.
Does something like this exist on CPAN? If it doesn't, does it exist anywhere? Or, would I be starting from scratch?
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.