I've created a new CVS repository at tt2.org for the Template Toolkit FAQ.

You can check it out like so:

  $ CVSROOT=:pserver:[EMAIL PROTECTED]:/TT-faq
  $ cvs login
  (Logging in to [EMAIL PROTECTED])
  CVS password: cvs
  $ cvs -z 3 co TT-faq

I've added all the names from the passwd and writers files for the 
other TT repositories, so that means that the following people can 
log in as themselves using their existing passwords and have write 
access:

  * Andy Wardley (abw)
  * Simon Matthews (sam)
  * Craig Barratt (craig) 
  * Mark Fowler (mark)
  * Darren Chamberlain (darren)
  * Dave Cross (dave)

If anyone else wants write access then just let me know.

Into the repository I've added a fledgling FAQ which is built from 
an XML source file via some Template Toolkit magic.  This is mostly 
the existing FAQ turned XML with a couple of other FAQ-related questions
added.

There are some simple page templates which generate the FAQ as a fairly
plain HTML file.  There's a script included which does the magic for you.
Sections and questions are numbered automatically and a table of contents
is generated and inserted at the top of the page.  

One of the requirements is that I should be able to integrate it easily
into the tt2.org web site, and also into the TT2 docs.  The way the 
templates are laid out (in the 'lib' directory) makes it possible to 
define different sets of page templates (lib/page/*) to create different
page styles without having to change any of the FAQ-specific XML munging
templates (lib/faq/*).  This is a Good Thing.  

I haven't yet integrated the new FAQ into the existing tt2.org style
(I'm in the process of rebuilding the entire site as it happens - more on
that later) but you can see what the plain HTML version looks like for now:

   http://tt2.org/faq.html

Anyway, Mark's in charge now and I know he loves a bit of XML XPath 
magic, so it's up to him if he wants to monkey around with it.  What
we've got here should be a good starting point to work from.

If anyone feels like writing questions and/or answers but doesn't want 
to mess around checking out CVS files, you could always just post them
to the list.  If you mark them up in the XML format then it'll be a piece
of cake to slot them in.

Example:
        <qna id="skyblue">
          <question>
            Why is the sky blue?
          </question>
          <answer>
            The wavelength of blue light is roughly half that of
            red light.  This causes blue light to be scattered by 
            the atmosphere nearly ten times more than red light.
            The more the light is scattered, the more visible it
            appears to us.  Hence, the sky looks blue.
          </answer>
        </qna>

You can include any XHTML markup in the question/answer, and there are
some special elements defined like <tt>...</tt> and <ttblock>...</ttblock>
(for TT example code), <perl>...</perl> and <perlblock>...</perlblock>
(for Perl code), <qnaref id="some_qna_id">...</qnaref> (for linking to 
other questions), and so on.  

The README file has all the details.

You might also find the source code enlightening if you've got FAQs of
your own to maintain.  You can plug in your own XML FAQ file and/or
modify the page templates to create your own look and feel.

Enjoy!

A


_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.ourshack.com/mailman/listinfo/templates

Reply via email to