-
Notifications
You must be signed in to change notification settings - Fork 267
/
index.yaws
88 lines (68 loc) · 2.72 KB
/
index.yaws
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<erl>
out(A) ->
[{ssi, "TAB.inc","%%",[{"index", "choosen"}]},
{ehtml,
[{'div', [{id, "entry"}],
[{h1,[],"Yaws"},
{p,[],"Yaws is a HTTP high perfomance 1.1 webserver particularly"
" well suited for dynamic-content webapplications. Two separate modes of operations are supported."},
{ul,[],
[{li,[],
{p,[],"Standalone mode where Yaws runs as a regular webserver "
"daemon. This is the default mode."}},
{li,[],
{p,[], "Embedded mode where Yaws runs as an embedded webserver in "
"another erlang application."}}
]},
{p,[], ["Yaws is entirely written in ",
{a, [{href, "http://www.erlang.org"}], "Erlang"},
" furthermore it is a multithreaded webserver where one "
"Erlang light weight process is used to handle each client."]},
{p,[], "The main advantages of yaws compared to other Web technologies"
" are performance and elegance. The performance comes from the "
" underlying Erlang system and its ability to handle concurrent "
" processes in an efficent way. Its elegance comes from Erlang as "
"well. Web applications dont have to be written in ugly adhoc "
"languages."},
{h2,[], "yaws.hyber.org"},
{p,[], ["The www page for Yaws is ",
{a ,[{href,"http://yaws.hyber.org"}], "yaws.hyber.org"},
" The documentation, examples as well as releases can be "
"found there, and of course, ",
{a ,[{href,"http://yaws.hyber.org"}],"yaws.hyber.org"},
" is itself powered by Yaws."]},
{p,[], ["A mailing list exists at: ",
{a,[{href,"https://lists.sourceforge.net/lists/listinfo/""erlyaws-list"}],
"https://lists.sourceforge.net/lists/listinfo/erlyaws-list"}]},
{h2, [], "News"},
gen_news(A)]}]},
{ssi, "END2",[],[]}].
gen_news(A) ->
case file:open(A#arg.docroot ++ "/news",[read]) of
{ok, Fd} ->
gen_news(Fd, io:get_line(Fd,''));
Err ->
{p,[], f("No news: ~p",[Err])}
end.
gen_news(Fd, eof) ->
file:close(Fd),
[];
gen_news(Fd, Line) ->
Items = gen_items(Fd, io:get_line(Fd, '')),
case Items of
[] ->
gen_news(Fd, io:get_line(Fd,''));
_ ->
X = [{'div', [{class, "news"}],
[{h3, [], Line},
{ul, [], Items}]}
],
[X | gen_news(Fd, io:get_line(Fd,''))]
end.
gen_items(Fd, [10]) ->
[];
gen_items(Fd,eof) ->
[];
gen_items(Fd,Line) ->
[{li, [], {p, [], Line}} |gen_items(Fd, io:get_line(Fd, ''))].
</erl>