Questions tagged [template-engine]

A template engine is software that is designed to process templates and content information to produce output documents.

A template engine is software that is designed to process templates and content information to produce output documents, for example:


Paul Sweatte, in an answer to a now-deleted question, provided the following resources on the evolution of separating content from presentation and insights on the historical evolution of template engines:

The W3 Word Processor Filters page is essential reading that should cover most of the basics. For more details, here some resources on the evolution of separating content from presentation:

Markup and typesetting languages are the earliest examples of templating.
Here is the Wikipedia definition:

A markup language is a modern system for annotating a document in a way that is syntactically distinguishable from the text. The idea and terminology evolved from the "marking up" of manuscripts, i.e., the revision instructions by editors, traditionally written with a blue pencil on authors' manuscripts. Examples are typesetting instructions such as those found in troff and LaTeX, or structural markers such as XML tags.

Here is a diagram:

                RUNOFF                      "Generic Coding"                 "Editorial Structure Tags"
           (Jerome Saltzer, 1964)         (William Tunnicliffe, 1967)          (Stanley Rice, pre-1970)
                    |                               |                                     |
                    |                               |                                     |
TeX          roff - nroff - troff                   |-------------------------------------|  (Don Knuth, 1977)   (Josef Osanna, 1973)                   |
                                                   GML
                                            (Charles Goldfarb, 1969)
                                                    |                       SCRIBE
                                                    |                   (Brian Reid, 1980)
                                                    |                          |
                                                    |--------------------------|
                                                  SGML
                                              (Standard, 1980)
                                             |                |
                                             |                |
                                           HTML              XML
                                    (Berners-Lee, 1990)    (Standard, 1998)

As far as web site templating, SSI is the mother of them all.

1649 questions
0
votes
1 answer

Accessing options properties inside for-each in knockout

I was wondering in the following example how I can access the relevant AttributeType property of $parent.contactFields? as $data looks up fieldCouplings not $parent.contactFields
0
votes
0 answers

Trying to write a more robust TemplateEngine with replacements defined externally

I am in the process of writing a TemplateEngine. The intention is that will read in a HTML file containing placeholders. Something along the lines of

lostinwpf
  • 633
  • 2
  • 9
  • 29
0
votes
1 answer

Html from variable in mako

Here is what i want to do, but have trouble figuring out: I have a variable: ${image} Which contains (%s is replaced with image data there): 'data:image/png;base64,%s' In mako template, i want to use this variable to provide background image:
user1841829
0
votes
1 answer

Web Templating Engine - Python

I need to build a web templating engine in Python. I know there are a few out there, but I need to write my own. I need to take care of two things: String substitutions For loop constructs Any help on this matter will be highly appreciated. I have…
Varun Shah
  • 53
  • 1
  • 7
0
votes
1 answer

Useful to re-write the complete project? Get an idea of building an homepage

I have some problems and I hope you will understand me and what I want and I hope you can help me. So, I started to program a project for many moths ago. I want to start a little gaming community. I read many tutorials, wrote many snippets and…
hookieV2
  • 15
  • 4
0
votes
0 answers

Are there any problems with JSP for a new greenfield project?

It seems, that JSP is regarded as deprecated or de-facto abandoned: There is no ecosystem around JSP. Most taglibs on the net are abandoned. The last Java EE tutorial that included JSP was for Java EE version 5. "JSP technology is considered to be…
Thomas Koch
  • 2,833
  • 2
  • 28
  • 36
0
votes
0 answers

JavaScript dynamically updated template compatible with Chrome App CSP

I know of exactly one JavaScript template engine that automatically updates the page when the model changes and that's also compatible with the Content Security Policy enforced for Chrome Apps (packaged apps): AngularJS. However, AngularJS is much…
0
votes
1 answer

How can i use partials in dustjs with expressjs when all my templates are remotely placed

All my Dustjs templates are kept precompiled in a database. To render the template I have this function tmplfn(options, function (err, html) { res.write(html); //res is the response object res.end(); }); But this fails when the templates…
Golak Sarangi
  • 809
  • 7
  • 22
0
votes
0 answers

Is there some template engine like mustache, but which targets CSS?

Shouldn't be useful to have templated CSS? Let's say for example I want to decide at run time the class names of my CSS, or wich id to apply the template CSS to. It should be feasible in practice, parsing CSS is relatively easy and injecting /…
janesconference
  • 6,333
  • 8
  • 55
  • 73
0
votes
1 answer

How can I customize answer posts in a theme based on the Minimal theme?

I want to customize the appearance of questions when they are in answer posts in my theme, which is based on the Minimal theme. I tried adding things from my previous template, which had asks formatted the way I want, but it didn't work. Here's what…
beth
  • 1,916
  • 4
  • 23
  • 39
0
votes
1 answer

Replacing tokens in a PHP applications

I am creating a small templating engine for our internal purpose. We have a several HTML templates that contains tokens in the form {token.name.value}. We submit it to the backend which then does its thing and replaces the tokens with their…
Blueboye
  • 1,374
  • 4
  • 24
  • 49
0
votes
1 answer

Template engine with CoffeeScript

I found the following template engines with CoffeeScript https://github.com/mauricemach/coffeekup (last commit 2 years ago) https://github.com/sstephenson/eco (last commit 2 years ago) https://github.com/ddopson/jade-coffeescript (last commit 4…
user977828
  • 7,259
  • 16
  • 66
  • 117
0
votes
1 answer

What's the least intrusive way to make dust.js able to render typeahead.js templates?

typeahead.js gives us the ability to render templates for our autocomplete suggestions using our engine of choice as long as the engine implements this API: // engine has a compile function that returns a compiled template var compiledTemplate =…
mabi
  • 5,279
  • 2
  • 43
  • 78
0
votes
1 answer

nested templates using velocity

I have a small java web project which should create a few web pages. All pages should have the same boilerplate (css, javascript, etc.) but indiviual content (i.e. the content of the main div.) What is the usual way of implementing this kind of…
michas
  • 25,361
  • 15
  • 76
  • 121
0
votes
1 answer

HTML outside of block in inheriting layout

Correct me If I wrong but It is not possible to use html code outside of block from the inheriting layout, right? Here is what I mean {# app/Resources/view/base.html.twig #} ...... <% block sidebar %>

...

<% endblock; %> {#…
objc_bd
  • 247
  • 1
  • 4
  • 11
1 2 3
99
100