summaryrefslogtreecommitdiffabout
path: root/htdocs
authorMichael Krelin <hacker@klever.net>2005-02-03 00:17:58 (UTC)
committer Michael Krelin <hacker@klever.net>2005-02-03 00:17:58 (UTC)
commitd379841850daab4693d596784b790b13e20e3a03 (patch) (side-by-side diff)
treeeafa246cd99308ea349aef90a708ef9f6d7a0418 /htdocs
parent870963df2dac72e433fd7f94cd1cccc8cd6ea2d0 (diff)
downloadsitecing-d379841850daab4693d596784b790b13e20e3a03.zip
sitecing-d379841850daab4693d596784b790b13e20e3a03.tar.gz
sitecing-d379841850daab4693d596784b790b13e20e3a03.tar.bz2
1. added a 'browse-through' navigation
2. improved performance by passing -flush to FastCgiExternalServer 3. emphasized links in text
Diffstat (limited to 'htdocs') (more/less context) (show whitespace changes)
-rw-r--r--htdocs/ancestry/layout.chtml24
-rw-r--r--htdocs/exceptions/compile.chtml2
-rw-r--r--htdocs/exceptions/index.chtml4
-rw-r--r--htdocs/exceptions/preprocess.chtml2
-rw-r--r--htdocs/exceptions/runtime.chtml2
-rw-r--r--htdocs/index.chtml3
-rw-r--r--htdocs/simple.chtml2
-rw-r--r--htdocs/sources.chtml1
-rw-r--r--htdocs/style.css28
9 files changed, 68 insertions, 0 deletions
diff --git a/htdocs/ancestry/layout.chtml b/htdocs/ancestry/layout.chtml
index 6147d37..0c167bc 100644
--- a/htdocs/ancestry/layout.chtml
+++ b/htdocs/ancestry/layout.chtml
@@ -1,38 +1,62 @@
% html(); return; /* vim:set ft=sitecing: */
%%derive page = "/ancestry/page.chtml";
+<%decl>
+ #define PN_PREV(h,d,t) urlPrev=h; descPrev=d; titlePrev=t;
+ #define PN_NEXT(h,d,t) urlNext=h; descNext=d; titleNext=t;
+</%decl>
+%%impl #include <sitecing/util.h>
%%impl #include "acconfig.h"
%%var bool b_svn = false;
+%%var std::string urlPrev;
+%%var std::string descPrev;
+%%var std::string titlePrev;
+%%var std::string urlNext;
+%%var std::string descNext;
+%%var std::string titleNext;
<%constructor>
if(strstr(PACKAGE_STRING,"svn"))
b_svn = true;
</%constructor>
+<%method void prevnext() %>
+% if(urlPrev.empty() && urlNext.empty()) return;
+% if(descPrev.empty() && descNext.empty()) return;
+ <div class="prevnext">
+% if(!(urlPrev.empty() || descPrev.empty())) {
+ <a class="prevnext-prev" href="<% urlPrev %>" title="<% sitecing::html_escape(titlePrev.empty()?descPrev:titlePrev) %>"><% sitecing::html_escape(descPrev) %></a>
+% }
+% if(!(urlNext.empty() || descNext.empty())) {
+ <a class="prevnext-next" href="<% urlNext %>" title="<% sitecing::html_escape(titleNext.empty()?descNext:titleNext) %>"><% sitecing::html_escape(descNext) %></a>
+% }
+ </div>
+</%method>
<%method void body() %>
<div id="content">
<%code>
if(!access(WEB_RUN_ROOT "/conf/banner_top",R_OK)) {
pass_file_through(WEB_RUN_ROOT "/conf/banner_top");
}
+ prevnext();
content();
if(b_strict && !access(WEB_RUN_ROOT "/conf/banner_bottom",R_OK)) {
pass_file_through(WEB_RUN_ROOT "/conf/banner_bottom");
}
</%code>
</div>
<div id="sidepanel">
% sidepanel();
</div>
</%method>
<%method void content() %>
</%method>
<%method void sidepanel() %>
<h1><% PACKAGE_STRING %></h1>
% if(b_svn) {
<h2>The site is running source from the source repository which may differ
from the one available for download. You can check it out from the <a
href="http://kin.klever.net/sitecing/repository">source repository</a>.</h2>
% }
% /* thank MSIE for this awful formatting */
<ul><li><a href="/" title="introduction to site-C-ing">overview</a><ul><li><a href="/simple" title="building a really simple page">simple page</a></li></ul></li><li><a href="/exceptions/" title="exceptions handling">exceptions</a><ul><li><a href="/exceptions/preprocess" title="preprocessor errors">preprocess</a></li><li><a href="/exceptions/compile" title="compiler errors">compile-time</a></li><li><a href="/exceptions/runtime" title="runtime exceptions">runtime</a></li></ul></li><li><a href="/sources" title="browse this site source files">sources</a></li></ul>
<%code>
if(!access(WEB_RUN_ROOT "/conf/banner_side",R_OK)) {
pass_file_through(WEB_RUN_ROOT "/conf/banner_side");
diff --git a/htdocs/exceptions/compile.chtml b/htdocs/exceptions/compile.chtml
index aa4c8df..68dd034 100644
--- a/htdocs/exceptions/compile.chtml
+++ b/htdocs/exceptions/compile.chtml
@@ -1,28 +1,30 @@
% html(); return; /* vim:set ft=sitecing: */
%%derive layout = "/ancestry/layout.chtml";
<%constructor>
b_strict = false;
+ PN_PREV("/exceptions/preprocess","preprocess","preprocessing errors");
+ PN_NEXT("/exceptions/runtime","runtime","runtime exceptions");
</%constructor>
<%codemethod string title() %>
return "compile-time exceptions handling";
</%codemethod>
<%method void content() %>
<h1>site-C-ing compile-time exception handling</h1>
<p>
Similar to <a href="/exceptions/preprocess">preprocessing exceptions</a>
there is a wide range of errors you may put into your code which will pass
through preprocessor and will be caught later at the compile-time.
</p>
<p>
Once you complete writing your <a
href="/view/htdocs/exceptions/development/compile.chtml" target="insert"
title="the link opens in the frame below">erroneous code</a> and
<em>site-C-ing</em> is done preprocessing it, it will feed the preprocessed
code into c++ compiler which will refuse to compile the code like this. This
is where <a href="/view/htdocs/handlers/exception_dev" target="insert"
title="the link opens in the frame below">the exception handler</a>,
specified in <a href="/view/htdocs/exceptions/development/.scrc"
target="insert" title="the link opens in the frame below">the configuration
file</a>, takes over the process and gives you <a
href="/exceptions/development/compile" target="insert" title="the link opens
in the frame below">the report</a>. Like with any handler, you may wish to
diff --git a/htdocs/exceptions/index.chtml b/htdocs/exceptions/index.chtml
index cc0ed8a..e66620a 100644
--- a/htdocs/exceptions/index.chtml
+++ b/htdocs/exceptions/index.chtml
@@ -1,26 +1,30 @@
% html(); return; /* vim:set ft=sitecing: */
%%derive layout = "/ancestry/layout.chtml";
+<%constructor>
+ PN_PREV("/simple","simple page","building a really simple page");
+ PN_NEXT("/exceptions/preprocess","preprocess","preprocessing errors");
+</%constructor>
<%codemethod string title() %>
return "exceptions handling";
</%codemethod>
<%method void content() %>
<h1>site-C-ing exception handling</h1>
<p>
The purpose of this section is to give an overview of the <em>site-C-ing</em>
exception handling mechanism. Before the web visitor can see the page each
site-C-ing component goes through a few stages, namely, preprocessing,
compiling and execution. Having three stages to go through also means the
stages one can fail to go through and three exciting opportunities to handle
different errors.
</p>
<p>
First each component is preprocessed so that you can feed the valid c++ code
to the compiler. Here is where the preprocessor can choke at your broken
source code. Once preprocessor failes to parse your code it will throw an
exception which <em>site-C-ing</em> will catch and pass to <a
href="/sources/htdocs/handlers/exception_dev" title="development mode
exception handler source">the exception handler component</a>. Want to <a
href="/exceptions/preprocess">read more</a> about preprocessor exception
handling?
</p>
<p>
diff --git a/htdocs/exceptions/preprocess.chtml b/htdocs/exceptions/preprocess.chtml
index 8516139..88b8741 100644
--- a/htdocs/exceptions/preprocess.chtml
+++ b/htdocs/exceptions/preprocess.chtml
@@ -1,28 +1,30 @@
% html(); return; /* vim:set ft=sitecing: */
%%derive layout = "/ancestry/layout.chtml";
<%constructor>
b_strict = false;
+ PN_PREV("/exceptions","exceptions","exception handling overview");
+ PN_NEXT("/exceptions/compile","compile-time","compile-time errors");
</%constructor>
<%codemethod string title() %>
return "preprocessor exceptions handling";
</%codemethod>
<%method void content() %>
<h1>site-C-ing preprocessor exception handling</h1>
<p>
It was one of those days when you just can't type right and can't think of
what you're typing. It is not unusual that, under such circumstances, you end
up with a code like <a
href="/view/htdocs/exceptions/development/preprocess.chtml" target="insert"
title="the link opens in the frame below">this</a> -- by the time you were
about to close your <code>&lt;%code&gt;</code> block you were thinking about
some constructor in some component elsewhere in the universe.
</p>
<p>
<em>site-C-ing</em> parser will see the inconsistency and throw an exception
which will be caught and passed to <a
href="/view/htdocs/handlers/exception_dev" target="insert" title="the link
opens in the frame below">the handler</a>, specified in <a
href="/view/htdocs/exceptions/development/.scrc" target="insert" title="the
link opens in the frame below">the configuration file</a>, which will produce
some nice, human-readable <a href="/exceptions/development/preprocess"
target="insert" title="the link opens in the frame below">output</a>. Well,
diff --git a/htdocs/exceptions/runtime.chtml b/htdocs/exceptions/runtime.chtml
index d0a8e14..9a72afd 100644
--- a/htdocs/exceptions/runtime.chtml
+++ b/htdocs/exceptions/runtime.chtml
@@ -1,28 +1,30 @@
% html(); return; /* vim:set ft=sitecing: */
%%derive layout = "/ancestry/layout.chtml";
<%constructor>
b_strict = false;
+ PN_PREV("/exceptions/compile","compile-time","compile-time errors");
+ PN_NEXT("/sources","sources","source browser");
</%constructor>
<%codemethod string title() %>
return "runtime exceptions handling";
</%codemethod>
<%method void content() %>
<h1>site-C-ing runtime exception handling</h1>
<p>
The component may throw an exception while executing and the
<em>site-C-ing</em> will gladly pass it to the handler component which will
give the user appropriate output (unless it throws an exception itself, of
course). Here you will see an example output provided by the handler bundled
with the <em>site-C-ing</em>.
</p>
<p>
Suppose you have <a href="/view/htdocs/exceptions/development/runtime.chtml"
target="insert" title="the link opens in the frame below">a component</a>,
which at some point throws an exception. Of course, <em>site-C-ing</em> will
catch the exception and pass it to <a
href="/view/htdocs/handlers/exception_dev" target="insert" title="the link
opens in the frame below">the handler</a>, specified in <a
href="/view/htdocs/exceptions/development/.scrc" target="insert" title="the
link opens in the frame below">the configuration file</a>, which will produce
some nice, human-readable <a href="/exceptions/development/runtime"
diff --git a/htdocs/index.chtml b/htdocs/index.chtml
index aa0979a..e8cedda 100644
--- a/htdocs/index.chtml
+++ b/htdocs/index.chtml
@@ -1,26 +1,29 @@
% html(); return; /* vim:set ft=sitecing: */
%%derive layout = "/ancestry/layout.chtml";
+<%constructor>
+ PN_NEXT("/simple","simple page","building a really simple page");
+</%constructor>
<%codemethod string title() %>
return "introduction";
</%codemethod>
<%method void content() %>
<h1>introduction to site-C-ing</h1>
<p>
This is a sample site, which is supposed to demonstrate <em>site-C-ing</em>
features. Since the <em>site-C-ing</em> is still at the early stages of
development or rather proof of concept, this site is also far from being
complete. I am planning to add more pages as the time permits, though.
</p>
<p>
Once you download and install <a
href="http://kin.klever.net/sitecing/">site-C-ing</a> you may wish to try
this sample site for yourself. The source is available from <a
href="http://kin.klever.net/sitecing/sources">the site-C-ing download
page</a>. After you download the source code, you should configure it using
the ever so popular <code>configure</code> script. It is likely that you will
want to pass the <code>--with-vhostname</code> option to configure to name
the apache virtual host.
</p>
<p>
The configure script will generate the apache vhost configuration for you,
which you can <code>Include</code> in the main apache configuration file.
diff --git a/htdocs/simple.chtml b/htdocs/simple.chtml
index 9900f00..845b840 100644
--- a/htdocs/simple.chtml
+++ b/htdocs/simple.chtml
@@ -1,28 +1,30 @@
% html(); return; /* vim:set ft=sitecing: */
%%derive layout = "/ancestry/layout.chtml";
<%constructor>
b_strict = false;
+ PN_PREV("/","overview","introduction to site-C-ing");
+ PN_NEXT("/exceptions","exceptions","exception handling overview");
</%constructor>
<%codemethod string title() %>
return "simple page";
</%codemethod>
<%method void content() %>
<h1>building a really simple page</h1>
<p>
Building a really simple page is really simple. I will not go into much detail
here. The example provided should speak for itself.
</p>
<p>
The component being written doesn't do much but show you the calendar for the
current month. First, take a look at <a
href="/view/htdocs/examples/calendar.chtml" title="the link opens in the frame
below" target="insert">the code</a> and, after you examined it, feel free to check out
<a href="/examples/calendar" title="the link opens in the frame below"
target="insert">the output</a>.
</p>
<div class="insert">
<iframe id="insert" name="insert" src="about:blank" width="95%" height="300">
<p>I wanted to put an &lt;iframe&gt; here, but your browser does not seem to
support it. That is okay, it still will open links somehow.</p>
</iframe>
diff --git a/htdocs/sources.chtml b/htdocs/sources.chtml
index b1eeed3..6341f49 100644
--- a/htdocs/sources.chtml
+++ b/htdocs/sources.chtml
@@ -1,32 +1,33 @@
% html(); return; /* vim:set ft=sitecing: */
%%derive layout = "/ancestry/layout.chtml";
%%derive sources = "/ancestry/sources.chtml";
<%impl>
#include <sitecing/sitecing_util.h>
</%impl>
<%constructor>
b_strict = false;
+ PN_PREV("/exceptions/runtime","runtime","runtime exceptions");
</%constructor>
<%codemethod string title() %>
return "runtime exceptions handling";
</%codemethod>
<%method void content() %>
<h1>browse this site sources</h1>
<ul class="sourcebrowser">
% for(int n=0;n<source_files_count;n++) {
% sourcefile_t& sf = source_files[n];
% if(!sf.name) { /* the beginning or the end of the directory */
% if(sf.dir) { /* the beginning */
<li class="dir"><% sf.dir %>/<ul class="dir">
% }else{ /* the end */
</ul></li>
% }
% }else{
<li class="file"><a href="/view/<% sf.dir %>/<% sf.name %>" title="<% sf.desc %>" target="insert"><% sf.name %></a></li>
% }
% }
</ul>
<%code>
string rfile = sitecing::normalize_path(
diff --git a/htdocs/style.css b/htdocs/style.css
index 3ab1b6f..83e308f 100644
--- a/htdocs/style.css
+++ b/htdocs/style.css
@@ -95,48 +95,52 @@ div#sidepanel ul a {
margin: 0.5ex;
border: 1px solid gray;
text-decoration: none;
background: white;
color: black;
}
div#sidepanel ul a:hover {
background: gray;
color: white;
}
div#sidepanel ul ul a {
padding-left: 2.5ex;
background: #e0e0e0;
}
div#sidepanel div.copyright {
text-align: center;
}
div#content h1 {
font-size: 140%;
color: gray;
font-weight: bold;
text-align: center;
margin: 1em;
+ clear: both;
+}
+div#content p a {
+ font-weight: bold;
}
div.insert {
text-align: center;
}
iframe#insert {
border: 1px solid black;
}
div.source h1 {
background: #e0e0e0;
border: 1px solid #808080;
padding-left: 1em;
margin: 0px;
font-size: 100%;
color: #000060;
overflow: hidden;
}
div.source ul {
background: #80c0c0;
margin: 0px;
padding: 1px 0px;
font-family: monospace;
font-size: 80%;
@@ -154,24 +158,48 @@ ul.sourcebrowser {
}
ul.sourcebrowser ul.dir {
padding: 1px 0px 2px 1em;
margin: 1px 0px 1px 0px;
}
ul.sourcebrowser li.dir {
margin: 1px 0px 1px 0px;
}
ul.sourcebrowser li.file {
list-style-type: none;
white-space: nowrap;
display: inline;
}
ul.sourcebrowser li.file a {
border: 1px solid gray;
padding: 1px 0.5ex;
text-decoration: none;
font-family: monospace;
}
ul.sourcebrowser li.file a:hover {
background: gray;
border: 1px solid black;
color: white;
}
+
+div.prevnext {
+ margin: 1ex;
+}
+div.prevnext a {
+ margin: 0.5ex 1em; padding: 0.2ex 0.5ex;
+ display: block; width: 30%;
+ border: solid 1px gray;
+ color: black;
+ text-decoration: none;
+}
+div.prevnext a.prevnext-prev {
+ float: left;
+ text-align: left;
+}
+div.prevnext a.prevnext-next {
+ float: right;
+ text-align: right;
+}
+div.prevnext a:hover {
+ background: gray;
+ border: black 1px solid;
+ color: white;
+}