As can be seen by looking at the source TBX of aTbRef, it can be useful to place all 'content' i.e. the data you are working on and wish to export, inside one container. This also makes it easy for that container to form the index page of an HTML export or root element for XML export, etc. Thus "A Tinderbox Reference File" is the index.html file for this website. All notes used in the visible web content are descended from this note.
So what else might there be outside that? Looking at aTbRef's outline root you will find:
- /UTILS/. A variety of utility agents and the documents prototypes. Tip, set the prototypes' container's $OnAdd to
$IsPrototype=true
. - /Boilerplate/. This holds some code-type notes with sections of code to be included in export templates. This makes the individual templates easier to maintain as boilerplate can be updated once for several different templates. Tinderbox's built-in 'Code' prototype is often used for this type of note as usually it is important that the code's text is not modified by the export process, e.g. inserting HTML paragraph tags, etc. as using the prototype saves the user setting lots of attributes to non-default settings in 'code' notes.
- /Templates. All the export templates needed are stored here: HTML, RSS, etc. Tip, set the container's $OnAdd to
$IsTemplate=true
; in aTbRef's case it is$Prototype="_template"
, as that sets a prototype for which $IsTemplate is already correctly set. - /CSS/. All CSS used by the website is exported from the TBX. If needed, the same method can be used for Javascript and the like. Look at HTML view for the CSS container. Note how it does not export but exports its children; also it uses $HTMLExportFileName to change the case (it could be the name) of the exported folder name. View the child's HTML view to see how the CSS filename is constructed. Having this data in a root container means it exports to a sub-folder of the exported web-site. Were the CSS notes nested more deeply in the outline, it would create a nest of folders. Thus having a root level container makes sense, especially if a root level content container is also used.
- an HTML site map. An HTML nested listing of the entire content outline. Clearly, placing this inside the content section would not be a good fit, and opens issues of unintended recursion, so it lives outside the content.
- Version checkers. These export small code pages used to allow users who prefer to consume aTbRef in TBX form to check their local document is up to date. See more here and here.
- Atom and RSS feeds. See more.
- Zippers. These use command line code to create separate Zip files of the TBX and the /images/ folder (all images have always lived outside the TBX). The latter is needed if running out an HTML site locally and without web access. See more here and here.