Comments (5)
I find no discussion on templating. I can think of several ways to implement a templating system with tufao, but, would like to hear why it's not there already?
Basically I don't know what is the right answer. What is the right template system? Are you sure? Why? Will your answer be the same tomorrow?
Maybe I could spend some time thinking about a good interface that could abstract all template systems, then I wouldn't mind to include the most popular template systems on Tufão.
I can only assume no one has though it necessary, and everyone is just using strings for HTML. Which is incredibly cumbersome.
I think template is important. qt-mustache is mentioned on the wiki.
from tufao.
If you think there is a right answer (or that a single answer is even possible), you don't understand software (or, more generally, problem solving). The goal with software specifically is to pick something reasonable, make sure the interface is in place, so that as better solutions come along, they are painless to implement. It's called 'refactoring'.
If it is easy to incorporate something like qt-mustache, there is nothing wrong to deferring the templating to it. An example would be great. Actually, an example on returning more than a little HTML would be great.
I just created a resource file (qrc) with some HTML files in it, and compiled it into my "hello" app. The HTML files use the standard Qt string templating, with the QString::arg() calls. I'd never say it's the 'right' solution, but it works, and could very easily be abstracted out, into something like qt-mustache. Then, it would be easy to have a Template class, that return codes , headers, & what-not could be set on, and the return from the handle requests would simply be to template.renderTemplate(args) or some-such.
A solution doesn't need to be large & daunting. And a poor solution is often better than no solution.
from tufao.
@treaves, fair enough. Let me express my concern reasonably.
I don't want to Tufão users to refactor their code after every Tufão release because I didn't invest enough time thinking about a good interface.
There is no code and there is a link to another template system on the wiki. So we can say the reason is laziness or lack of interest (or time).
from tufao.
@treaves, PS: I liked your comment.
from tufao.
I've been watching tufao for some time.
In my experience, much of the web is moving towards client side html rendering. (You know, Google's AngularJS, EmberJS, etc.)
In other words you may not have to do anything other than helping the users deliver data easily in various formats such as Json, Protobuf, Xml or even Base91.
from tufao.
Related Issues (20)
- Data is truncated when using WebSocket to transfer data over 128k HOT 2
- can't link apps in debug mode on VS HOT 6
- apps hang when linked to wrong library configuration on VS
- problem using HttpServerRequestRouter with Visual Studio HOT 2
- typo in httpserverrequestrouter.cpp
- Only the first cookie is considered HOT 1
- doc: ldconfig after install HOT 1
- Move news section from README.md to CHANGELOG.md
- Add some more shields from Shields.io
- SIGSEGV when using int HttpServerRequestRouter::map(std::initializer_list<Mapping> map) HOT 1
- Socket stops to accept connexion
- Loop parsing POST contains request with two "readyRead" HOT 5
- websocket transform large data data loss HOT 2
- Remove an unnecessary null pointer check HOT 1
- Create Conan package
- Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers. HOT 1
- server close connection after server response client HOT 2
- How to interact with HTML file
- incoming urls with # i.e http://localhost/#index.html HOT 4
- What is the maximum amount of data for a single transfer? HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tufao.