File: quick-start.html

package info (click to toggle)
pubtal 3.5-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch, wheezy
  • size: 1,296 kB
  • ctags: 910
  • sloc: python: 8,027; xml: 150; makefile: 49
file content (58 lines) | stat: -rw-r--r-- 4,807 bytes parent folder | download
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>Quick Start Guide for PubTal</title>
	<link href="../style/site.css" type="text/css" rel="stylesheet">
</head>
<body>
<h1>Quick Start Guide for PubTal</h1>
  <p id="subject">An introduction to how PubTal works.</p>
  <div><p>PubTal takes content files (e.g. text files), one or more template files (containing the website's look and feel), and produces corresponding HTML/XHTML files.&nbsp; Several different content formats are supported by default, and more can be added through a plugin mechanism.&nbsp; </p>
<p>This quick start guide is based on the <dfn>HTMLText</dfn> content type which is written in plain text with a limited amount of HTML markup.&nbsp; Each HTMLText file can contain (optional) name-value pairs at the start of the file, which are then available for reference in the template.</p>
<p>The body of an HTMLText file is a mixture of normal text and HTML markup, such as &lt;b&gt; tags for bold, and &lt;a&gt; for links.&nbsp; PubTal will automatically add paragraph tags (&lt;p&gt;) and newline tags (&lt;br&gt;) to the body text when generating the web page.</p>
<p>PubTal <dfn>templates</dfn> are written as normal HTML/XHTML pages, but with <dfn>TAL</dfn> commands added in that tell PubTal where to place content in the generated page.&nbsp; TAL is a simple template language consisting of just 7 commands, and can be easily learnt from the examples.&nbsp; More information on writing PubTal templates can be found in the <a href="conf/templates.html">Template Basics</a> section of this manual.</p>
<p>Here is a simple example of how you can use the most basic features of PubTal.&nbsp; The directory layout for this example site is:</p>
<pre><code>simplesite/site.conf
simplesite/content/index.txt
simplesite/template/template.html
simplesite/dest/index.html
</code></pre>
<p>The site.conf file will be empty because this example uses the default configuration.&nbsp; The file "simplesite/dest/index.html" file is generated by PubTal when we run the following command:</p>
<pre><code>updateSite.py simplesite/site.conf</code></pre>
<p>The file "simplesite/content/index.txt" has the following content, in which a name-value pair of "title" is defined, and two HTML paragraphs are created:</p>
<pre><code>title: My first page.

This is the first paragraph.
And this is a new line in the first paragraph.

The second paragraph shows &lt;b&gt;bold&lt;/b&gt; and a &lt;a href="http://www.owlfish.com/"&gt;link&lt;/a&gt;.
</code></pre>
<p>The file "simplesite/template/template.html" is an example PubTal template containing TAL commands that position the content within the HTML page:</p>
<pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
&lt;html&gt;
&lt;head&gt;
&nbsp; &lt;title&gt;An Example&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&nbsp; &lt;h1 tal:content="page/headers/title"&gt;Title&lt;/h1&gt;
&nbsp; &lt;div tal:content="structure page/content"&gt;Body&lt;/div&gt;
&nbsp; &lt;p&gt;Last modified: &lt;b tal:replace="page/lastModifiedDate"&gt;Date&lt;/b&gt;&lt;/p&gt;
&lt;/body&gt;
</code></pre>
<p>The contents of the H1 heading will be the title taken from the "title:" line of the text file, with the main content appearing in the DIV element.&nbsp; The name-value "title" is just an example; multiple name-values can be used and referenced in the template in the same way as "title".&nbsp; This is the <a href="example/index.html">resulting HTML file</a>. </p>
<p>By separating content from HTML templates in this fashion, adding and maintaining web pages becomes very easy.&nbsp; To change the design of the website simply modify the template and then regenerate the pages with the single command updateSite.py.&nbsp; Different templates can be used in different parts of the site, with common parts shared between them.&nbsp; Default name-value pairs (accessed through the "page/headers/name" TAL path) can be set, and all configuration is inherited down through the directory structure.</p>
<p>To make learning PubTal easier there are several examples included with the download.&nbsp; The easiest one to start with is in the "examples/homepage" directory, which provides a simple example of how to use a PubTal template to build site navigation links.</p>
</div>
	  
	
  <div class="navbar">
  <a href="index.html" title="Contents">Contents</a>
  </div>
  <p id="version">PubTal Version 3.5</p>
  <div id="footer">
  <p>File: quick-start.txt</p>
  <p>Last modified: Fri, 27 Jul 2007 18:34:31 BST</p>
  <p>Copyright 2011 Colin Stewart</p>
  <p title="PubTal is a template driven web site publisher.">Made with <a href="http://www.owlfish.com/software/PubTal/">PubTal</a> 3.5</p>
  </div>
</body>