summaryrefslogtreecommitdiff
path: root/src/SW/sitemake/document.en.rest.txt
blob: 3ff27228384425df2db15f9722736199d929e9fa (plain)
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
=============================================
SiteMake - how this site used to be generated
=============================================
:Id: SW/sitemake
:CreationDate: 2003-01-31 19:03:19
:tags: software
 
Motivations
===========
 
Ever since I discovered XML_ and XSLT_, I've been looking for an easy
and confortable way to keep content and presentation totally
separate. I started using XWeb_, which is a good program, but with
some problems:
 
* it's written in Java (OK, OK, this is personal taste)
* it "tweaks" files to add (navigational) information, and I thought
  it was not necessary
* it does (did?) not have dependency control functionalities (like
  ``make``)
 
Shortly after version 0.3 I lost sync with the official codebase
because of some modifications of mine, and I did not follow later
developments.
 
Given the high level of correctness attained by the `Gnome XSLT
library`_, I decided to try and look if it was possible to use just
``xsltproc`` and ``make`` to obtain the same results.
 
So I developed a DTD to describe the structure of the site, a
stylesheet to convert this structure into a makefile, and retouched
the stylesheets to keep them working after the modifications.
 
How it works
============
 
Given a description of the site's structure in the file
``sitemap.xml``, the stylesheet ``compile.xsl`` generates a
``Makefile`` containing rules for the transformation of every page,
along with their prerequisites.
 
In this way calling ``make`` causes the regenaration of only those
files whose source have actually been modified. Moreover, each
stylesheet implicitly gets two parameters: ``sitemapuri``
containing the URI of the sitemap relative to the stylesheet, and
``active`` which is an XPath expression indicating, inside
the sitemap, the node corresponding to the page being
transformed. This way the stylesheets can access all relevant
navigational information.
 
You can `consult the software's sources`__.
 
.. _XML: https://www.w3.org/TR/REC-xml
.. _XSLT: https://www.w3.org/TR/xslt
.. _XWeb: https://xweb.sourceforge.net
.. _`Gnome XSLT library`: https://gitlab.gnome.org/GNOME/libxslt/-/wikis/home
.. __: https://www.thenautilus.net/cgit/sitemake/