18

Possible Duplicate:
C++ HTML template framework, templatizing library, HTML generator library

Planning to write a website in C++. Would like to use a template system like Clearsilver, but maybe there's a better alternative?

Community
  • 1
  • 1
Bjorn
  • 69,215
  • 39
  • 136
  • 164

4 Answers4

11

Wt (pronounced 'witty') is a C++ library and application server for developing and deploying web applications. It is not a 'framework', which enforces a way of programming, but a library.

yesraaj
  • 46,370
  • 69
  • 194
  • 251
  • That's sweet, I'm glad I asked then, even though it's a duplicate. :) – Bjorn Feb 11 '09 at 17:23
  • 6
    it is GPL license so my not be able to use in your commercial project. – rjoshi Jan 11 '11 at 17:28
  • 1
    this really completely answer a question "What's a good HTML template engine for C++"... while Wt has WTemplate class, it's kinda bad to have to link against whole Wt in order to use just that class.. plus it's WWidget, so there maybe some problems when used in other way than intended – graywolf Jul 01 '15 at 07:22
  • An alternative could be Inja (https://github.com/pantor/inja) that's a template engine for modern C++, loosely inspired by jinja for python. – Andrews Cordolino Sobral Aug 01 '21 at 14:10
10

Check out Grantlee: based on Django's template system, but using C++ and Qt.

Kristian
  • 6,357
  • 4
  • 36
  • 37
10

To add to the previous question:

CTemplate

CTPP

You could also interface with ClearSilver (written in C) with C++.

alphadogg
  • 12,762
  • 9
  • 54
  • 88
  • CTemplate seems to be gone and CTPP seems to be also gone as it redirects to a russian website with some message (in russian) – AntonioCS Aug 05 '19 at 06:23
3

You can have a look at cgicc which help handling posted data, but it's not actually for the html generation part. Otherwise I think Clearsilver is a very good template engine that has been used professionally

EDIT: Old post, but looks like CS has been saved on github https://github.com/blong42/clearsilver

epatel
  • 45,805
  • 17
  • 110
  • 144