Home > Implementation > File Types

File Types

Page content file body.htm

This file contains the body content of the web page. You can generate it with any tool that fulfils the following requirements:

The string Tab Name can be chosen freely. It is used for the navigation and shall be short version of the page title.

The string nn can be chosen freely. It determines the order of web page siblings in the navigation. The script trwnavs.py will sort on the nn string. Hence it is reasonable to use strings like

10
20
30

for nn. Such a scheme allows to insert twigs in the tree later. For example 15 would then sort between 10 and 20.

If the <meta name="htOrder" content="nn"/> element is missing, then trgensit falls back to sort the siblings according to "Tab Name".

I chose the name body.htm for the page content file. That name can be changed by editing the file trWLib.py.

The specific body.htm file that forms the root of the web site tree is special in the sense that it must in addition contain the element

<meta name="htHom" content="y"/>

in the head element of the HTML. This meta element signals to the script that the web site tree starts here. The directory where this special body.htm is located, I call home directory.

The body.htm files do not need to reference a central CSS style sheet, because that will later be achieved by the final index.htm files. However, body.htm can contain styles that are specific to that page.

Auxiliary file with navigation information trWNav.xml

The auxiliary files trWNav.xml with navigation information are purely an intermediary artifact to help add navigation information to each web page. Each trWNav.xml file complements a body.htm file and sits in the same directory. More…. The script trwnavs.py generates this file. trwnvall.py is a recursive version that processes a whole sub-tree.

I chose the name trWNav.xml for the auxiliary file. That name can be changed by editing the file trWLib.py.

Final web page file index.htm

In a final processing step, the final web page file gets constructed.

I chose the name index.htm for the web page file. That name can be changed by editing the file trWLib.py. default.htm would also be a traditional file name choice. You might prefer the extension html over htm.

index.htm gets constructed in the same directory as body.htm and trWNav.xml. Only index.htm shall be uploaded to the web server.

XSLT style sheet file trWSite.xsl

The XSLT style sheet file trWSite.xsl determines how an index.htm file gets constructed from the body.htm and the trWNav.xml file. More…

trWSite.xsl exists only once for the whole site. Because it exists only once and is not meant to be uploaded to the web server, I located it in the directory above the home directory.

I chose the name trWSite.xsl for the XSLT style sheet file. That name can be changed by editing the file trWLib.py.

CSS style sheet file

This file is optional, but highly recommended. The scripts of the trgensit package do not rely on its existence.

However is is useful to equip each index.htm file with a reference to a central CSS style sheet. The XSLT transformation style sheet trWSite.xsl can generate a

<link rel="stylesheet" type="text/css" href="..."/>

element in the head element of each index.htm file. The (relative) URL in href="…" is generated automatically, by using appropriate elements from trWNav.xml

By convention, I call the CSS file site.css and locate it in the home directory for use with the complete site.

You might want to style navigation and other elements that appear in each index.htm file. These styles shall be defined in site.css. Hence in trWSite.xsl you might want to reference the styles defined in site.css.


Last change: 2024-09-28
© 2002-2024 Dr. Thomas Redelberger redetho(at)gmx.de