Here is described how to create and organize any kind of documents. This includes man pages, info files, html-docs printed output and output of programs.
Snippets are Texinfo files which are intended to be included into other Texinfo documents. They are building blocks of text.
So they do not include standard Texinfo header information. An example of a snippet is authors.snippet.texinfo which can look like this:
The following persons have contributed to this package:
@itemize
@item
@email{joerg@@siliconbrain.com, Joerg Kunze}
@end itemize
@c $siliconBrainRelease: 0.2.3 $
@c $Id: siliconBrain.main.texinfo,v 1.55 2004/12/14 23:31:27 joerg Exp $
@c $siliconBrainSaveStamp: 2004/12/14 22:37:42, Joerg Kunze$
The revision control information like $siliconBrainRelease is
just held in comments. They are not inside @set commands so
they don't overwrite settings done in the main document, which
includes snippets.
Snippet files are named with the two level extension .snippet.texinfo. This is that make knows what to do with it. The extension .texinfo indicates that they are Texinfo files and that emacs should highlight them accordingly, and that they are processed with for example makefinfo. The part .snippets indicates make that they are snippets.
One common way to use snippets as the building blocks of your documents is just to include them in your main Texinfo files:
@include authors.snippet.texinfo
In that way you avoid redundancies in your Texinfo documents. But what distinguishes snippets form other Texinfo included files is, that out of them, siliconBrain's makefile automatically generates a text and a html version into temporary/data. So in our example we will have the two files:
distribution/data/authors.snippet.html
distribution/data/authors.snippet.text
Using these files in your application program, by reading and displaying them, the application programs output can be based on the same Texinfo files. This further reduces the redundancy of document information.
So for example we have the line
cat "distribution/data/longDescription.snippet.html"
inside the webify.bash to reuse the same documentation part in the creation of your projects web page.
If you will use the snippet not while making a package, but while you run it should write:
cat "$siliconBrainPath/data/longDescription.snippet.html"
if you reuse document parts from siliconBrain or
cat "$yourPackagePath/data/longDescription.snippet.html"
if its a part of your package.
There is the special case of standard snippets, which are used to create the capital files like AUTHORS. The capital files are created by copying the generated text version of the corresponding snippet into the projects root directory.
When you create a new project these snippets are automatically copied into your projects root directory from templates. You never should edit the capital files by your self (except RELEASE, which is not generated out of Texinfo snippets). Always edit the corresponding Texinfo snippet.
There are other snippets, which are copied into your project from templates:
All these files are also included in your main Texinfo document, which is used for printed output and as manual on your web site.
Using snippets thus guarantees, that the capital files (like README), your web pages, the printed manual and your programs output, contain the same information. And this with no redundancy and no double work.