diff --git a/tutorial/Skylark03/Skylark03.upp b/tutorial/Skylark03/Skylark03.upp index a3c5327d9..0557abf88 100644 --- a/tutorial/Skylark03/Skylark03.upp +++ b/tutorial/Skylark03/Skylark03.upp @@ -1,4 +1,4 @@ -description "Witz: links to handlers\377"; +description "Witz links to handlers\377"; uses Core, diff --git a/tutorial/Skylark04/Skylark04.upp b/tutorial/Skylark04/Skylark04.upp new file mode 100644 index 000000000..a332cce56 --- /dev/null +++ b/tutorial/Skylark04/Skylark04.upp @@ -0,0 +1,14 @@ +description "Combining Witz templates using #define and #include\377"; + +uses + Core, + Skylark; + +file + base.witz, + index.witz, + main.cpp; + +mainconfig + "" = "SSE2 MT"; + diff --git a/tutorial/Skylark04/base.witz b/tutorial/Skylark04/base.witz new file mode 100644 index 000000000..248554775 --- /dev/null +++ b/tutorial/Skylark04/base.witz @@ -0,0 +1,8 @@ + +#TITLE + +#BODY + + + +#define TITLE Generic title \ No newline at end of file diff --git a/tutorial/Skylark04/index.witz b/tutorial/Skylark04/index.witz new file mode 100644 index 000000000..b20dbba1a --- /dev/null +++ b/tutorial/Skylark04/index.witz @@ -0,0 +1,6 @@ +#include Skylark04/base + +#define TITLE MyApp title + +#define BODY +This is MyApp body html! diff --git a/tutorial/Skylark04/init b/tutorial/Skylark04/init new file mode 100644 index 000000000..f5a38d7e2 --- /dev/null +++ b/tutorial/Skylark04/init @@ -0,0 +1,5 @@ +#ifndef _Skylark04_icpp_init_stub +#define _Skylark04_icpp_init_stub +#include "Core/init" +#include "Skylark/init" +#endif diff --git a/tutorial/Skylark04/main.cpp b/tutorial/Skylark04/main.cpp new file mode 100644 index 000000000..2f127b018 --- /dev/null +++ b/tutorial/Skylark04/main.cpp @@ -0,0 +1,28 @@ +#include + +using namespace Upp; + +SKYLARK(HomePage, "") +{ + http.RenderResult("Skylark04/index"); +} + +struct MyApp : SkylarkApp { + MyApp() { + root = "myapp"; + #ifdef _DEBUG + prefork = 0; + use_caching = false; + #endif + } +}; + +CONSOLE_APP_MAIN +{ +#ifdef _DEBUG + StdLogSetup(LOG_FILE|LOG_COUT); + Ini::skylark_log = true; +#endif + + MyApp().Run(); +}