3 ms·
Sorry einhverfr I can't reply to your comment - but what I think you're talking about is trying to abstract display for HTML, PDF, LaTeX, whatever into a common
by dools 15y ago
Sorry einhverfr I can't reply to your comment - but what I think you're talking about is trying to abstract display for HTML, PDF, LaTeX, whatever into a common markup language or template, then repurpose that markup for each output format. Does that sound correct?
So like, you'd want to be able to have something like:
<article>
<title><% print article.title %></title>
</article>
then do something like:
$tpl->article = fetchSomeArticleFromTheDb()
$tpl->output('template_name',Format::PDF)
My argument to that would be that there's no realy need for that abstraction - you don't gain anything by it because you have to have some abstracted output engine that is capable of doing that HTML can already do, which is like, HTML :)
Hey, I'd love to continue the discussion, but I think the HN comments are kind of limited in how much they want you to discuss here, feel free to email me iain@workingsoftware.com.au
EDIT: oops, code formatting
- einhverfr 15y agoNot really. I will email you though :-) I will probably post something on the selection and design of our templating system for LedgerSMB in my blog too (http://ledgersmbdev.blogspot.com http://ledgersmbdev.blogspot.com) by the end of the week.
- einhverfr 15y agoJust to be clear, I am not entirely hostile to the idea here. I just think that there are plenty of cases where generating high quality printed content or the like doesn't work with it and templating is a lot cleaner in those environments. And when your application already requires templating for a reason like that, adding an entirely different way of handling another output format adds needless complexity. One of the useful applications of dools' ideas is that you could have a mockup which included lorem ipsums or other dummy text. This would make it easier for web developers to test layout. OTOH, as I say, I am not at all convinced that it is a net win for programs that generate multiple formats of output./