An integrated web templating environment
Project description
General idea
Static web site generator, based on well understood MVC - Model, View, Controller - design philosophy. The general idea behind MVC from web application’s perspective is
+--------+
|template|
+--------+
|
V
+-------+ +----------+ +------+ +-----+
|request|-->|controller|--->|action|<---|model|
+-------+ +----------+ +------+ +-----+
|
V
+---------+
|HTML page|
+---------+
|
V
goes to the client +-------------+
<---------------------|http-response|
+-------------+
The general idea being that,
http request reaches web-application’s controller logic.
controller resolves request to web-action by parsing request-URL.
the action-logic gathers necessary context information from database models and other sources.
a html-template is identified, and the final HTML page is generated using context information from models and page-layout from one or more template files.
pagd follows, more or less, a similar principle to build a web-site from a collection of files organised as a directory tree. Here is a brief idea on how it is done
+------+ +---------+ +-------------+
|layout|--->|generator|<---->|page-iterator|
+------+ +---------+ +-------------+
| ^
| | +------------+
V +<---------|page-context|
+---------+ | +------------+
|Html-page| |
+---------+ | +-------------+
| +<---------|page-template|
| | +-------------+
V +------------+
+--------+ |page-content|
|web-site| +------------+
+--------+
Features
generates static output, hence can be hosted anywhere.
pluggable layouts.
I am currently using pagd.myblog layout for publishing my blog articles.
It is possible to create any number of layout either as part of pagd tool or as separate package.
although layouts are encouraged to follow the Model-View-Controller concept explained above, it is upto the layout-plugin to define a structure and meaning of layout’s source directory-tree.
everything that needs to get done by pagd is done through pagd command line interface.
command line interface comes with simple sub-commands like,
create, to create a new layout.
gen, to generate static web site from a source layout.
sub-commands are plugins and can be extended by implementing pagd.interfaces.ICommand interface.
to use pagd as python library, refer to script.py module under pagd package.
only part that cannot be configured, constumized or entirely replaced, is the name of the tool ;)
License: GPLv3 license
Requires: Linux, Python-3.x, Pluggdapps.
To interpret markdown text, python-markdown needs to be installed.
To interpret rst text, docutils needs to be installed.
To interpret raw-html, python-lxml needs to be installed.
If you need source code highlighting in your rst text, pygments and docutils needs to be installed.
Status: Core design stable. Not expected to change.
Refer to glossary and documentation for default layout pagd.myblog.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.