mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
.Skylark tutorial
git-svn-id: svn://ultimatepp.org/upp/trunk@5137 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
2f0cd04bbe
commit
3bcac67ebb
6 changed files with 62 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
|||
description "Witz: links to handlers\377";
|
||||
description "Witz links to handlers\377";
|
||||
|
||||
uses
|
||||
Core,
|
||||
|
|
|
|||
14
tutorial/Skylark04/Skylark04.upp
Normal file
14
tutorial/Skylark04/Skylark04.upp
Normal file
|
|
@ -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";
|
||||
|
||||
8
tutorial/Skylark04/base.witz
Normal file
8
tutorial/Skylark04/base.witz
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<html>
|
||||
<title>#TITLE</title>
|
||||
<body>
|
||||
#BODY
|
||||
</body>
|
||||
</html>
|
||||
|
||||
#define TITLE Generic title
|
||||
6
tutorial/Skylark04/index.witz
Normal file
6
tutorial/Skylark04/index.witz
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#include Skylark04/base
|
||||
|
||||
#define TITLE MyApp title
|
||||
|
||||
#define BODY
|
||||
This is MyApp body html!
|
||||
5
tutorial/Skylark04/init
Normal file
5
tutorial/Skylark04/init
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#ifndef _Skylark04_icpp_init_stub
|
||||
#define _Skylark04_icpp_init_stub
|
||||
#include "Core/init"
|
||||
#include "Skylark/init"
|
||||
#endif
|
||||
28
tutorial/Skylark04/main.cpp
Normal file
28
tutorial/Skylark04/main.cpp
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#include <Skylark/Skylark.h>
|
||||
|
||||
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();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue