Thread: [Cppcms-users] No "\n" on compiled templates
Brought to you by:
artyom-beilis
From: Daniel R. <dan...@li...> - 2012-11-08 12:46:59
|
Hello there ! There's a way to compile a template using without the "\n" character? Thanks ! Daniel |
From: Artyom B. <art...@ya...> - 2012-11-08 13:24:28
|
Currently no Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: Daniel Rios <dan...@li...> >To: cppcms <cpp...@li...> >Sent: Thursday, November 8, 2012 2:46 PM >Subject: [Cppcms-users] No "\n" on compiled templates > > > >Hello there ! There's a way to compile a template using without the "\n" character? > >Thanks ! > >Daniel > >------------------------------------------------------------------------------ >Everyone hates slow websites. So do we. >Make your web apps faster with AppDynamics >Download AppDynamics Lite for free today: >http://p.sf.net/sfu/appdyn_d2d_nov >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
From: Lee E. <lee...@gm...> - 2012-11-08 21:34:01
|
I wonder why you would want something like this, and the only option i have in mind is to have the app deliver a "minified" html output to the clients. sadly introducing something like this into the template mechanism can break the ability to render different content types using the same mechanism (consider an app that render html responses, but also uses the same template mechanism to generate text only emails (where \n are important) i think that the correct way to do it is to provide some way to install a filter on the output stream - so it will skip over the characters that can be minified On Thu, Nov 8, 2012 at 2:46 PM, Daniel Rios <dan...@li...> wrote: > Hello there ! There's a way to compile a template using without the "\n" > character? > > Thanks ! > > Daniel > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_nov > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > -- -- lee Lee Elenbaas lee...@gm... |
From: Artyom B. <art...@ya...> - 2012-11-09 15:17:30
|
>________________________________ > From: Lee Elenbaas <lee...@gm...> >To: cpp...@li... >Sent: Thursday, November 8, 2012 11:33 PM >Subject: Re: [Cppcms-users] No "\n" on compiled templates > > >I wonder why you would want something like this, and the only option i have in mind is to have the app deliver a "minified" html output to the clients. >sadly introducing something like this into the template mechanism can break the ability to render different content types using the same mechanism (consider an app that render html responses, but also uses the same template mechanism to generate text only emails (where \n are important) > Also note that the best minification already exists - gzip compression enabled by default. The NL removal is mostly to make HTML more nice looking. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/> |
From: Artyom B. <art...@ya...> - 2012-11-09 15:15:13
|
I thought about adding some kind of special switch like <% autotrim (on|off|empty|nl) %> Where on - trims all wite space from the text spegments off - uses as today empty - remove blocks that consist of WS only nl - trim up to first new line including for stuff like <% template render() %> <!DOCTYPE html> to remove leading white space and new line. Volunteers to implement? Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: Lee Elenbaas <lee...@gm...> >To: cpp...@li... >Sent: Thursday, November 8, 2012 11:33 PM >Subject: Re: [Cppcms-users] No "\n" on compiled templates > > >I wonder why you would want something like this, and the only option i have in mind is to have the app deliver a "minified" html output to the clients. >sadly introducing something like this into the template mechanism can break the ability to render different content types using the same mechanism (consider an app that render html responses, but also uses the same template mechanism to generate text only emails (where \n are important) > > >i think that the correct way to do it is to provide some way to install a filter on the output stream - so it will skip over the characters that can be minified > > > >On Thu, Nov 8, 2012 at 2:46 PM, Daniel Rios <dan...@li...> wrote: > >Hello there ! There's a way to compile a template using without the "\n" character? >> >>Thanks ! >> >>Daniel >> >>------------------------------------------------------------------------------ >>Everyone hates slow websites. So do we. >>Make your web apps faster with AppDynamics >>Download AppDynamics Lite for free today: >>http://p.sf.net/sfu/appdyn_d2d_nov >>_______________________________________________ >>Cppcms-users mailing list >>Cpp...@li... >>https://lists.sourceforge.net/lists/listinfo/cppcms-users >> >> > > > >-- >-- >lee >Lee Elenbaas >lee...@gm... > > >------------------------------------------------------------------------------ >Everyone hates slow websites. So do we. >Make your web apps faster with AppDynamics >Download AppDynamics Lite for free today: >http://p.sf.net/sfu/appdyn_d2d_nov >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
From: sergey l. <ccp...@gm...> - 2012-11-09 16:14:14
|
Hi All! The future to remove white spaces seems helpful for me. Artyom, I like your suggested functionality, but I don't have enough experience yet to implement it. On Fri, Nov 9, 2012 at 7:15 PM, Artyom Beilis <art...@ya...> wrote: > I thought about adding some kind of special switch like > > <% autotrim (on|off|empty|nl) %> > > Where > > on - trims all wite space from the text spegments > off - uses as today > empty - remove blocks that consist of WS only > nl - trim up to first new line including for stuff like > <% template render() %> > <!DOCTYPE html> > > to remove leading white space and new line. > > Volunteers to implement? > > > Artyom Beilis > -------------- > CppCMS - C++ Web Framework: http://cppcms.com/ > CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ > > ------------------------------ > *From:* Lee Elenbaas <lee...@gm...> > *To:* cpp...@li... > *Sent:* Thursday, November 8, 2012 11:33 PM > *Subject:* Re: [Cppcms-users] No "\n" on compiled templates > > I wonder why you would want something like this, and the only option i > have in mind is to have the app deliver a "minified" html output to the > clients. > sadly introducing something like this into the template mechanism can > break the ability to render different content types using the same > mechanism (consider an app that render html responses, but also uses the > same template mechanism to generate text only emails (where \n are > important) > > i think that the correct way to do it is to provide some way to install a > filter on the output stream - so it will skip over the characters that can > be minified > > > On Thu, Nov 8, 2012 at 2:46 PM, Daniel Rios <dan...@li...> wrote: > > Hello there ! There's a way to compile a template using without the "\n" > character? > > Thanks ! > > Daniel > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_nov > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > > -- > -- > lee > Lee Elenbaas > lee...@gm... > > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_nov > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_nov > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > |