Skip to content

Templating Configuration

Loris Sauter edited this page Jul 30, 2020 · 2 revisions

Templating configuration

Lookup ordering

  1. Is in the directory of the executing jar a cs108pet.config file with a respective templating property?
  2. Is in the directory of the executing jar a folder templating?
  3. Is there a templating.config file?
  4. Are there any .template files:
  5. Is in the directory of the executing jar a templating.config file?
  6. Uses built in default markdown templates

Form of the templating configuration

Essentially, the templating configuration is a JSON-object. See the following example:

{
	"extension": "html",
	"templates": {
		"requirement": "requirement.html",
		"milestone": "milestone.html",
		"catalogue": "catalogue.txt",
		"progress": "progress.asfd",
		"group-milestone": "groupMS.md",
		"group": "g.template"
	}
}

The extension property is mandatory.

The templates is optional, if omitted it is assumed that the template files are named like the templates properties and have the template extension.

If any of the six properties of templates object is missing, it is assumed that the default template file (e.g. default template file for requirements: requirement.template) is present as a sibling of the templating.config file.

One special usage has the symbol #, which stands for that this template is ignored and thus handled as if there was nothing. Thus in the following configuration the rendering of milestone would be omitted:

{
	"extension":"html",
	"templates":{
		"milestone":"#"
	}
}

Configuration within cs108pet.config

Within the cs108pet.config file use the same JSON-object as mentioned above. The object is named templating:

{
	"templating": {
		"extension": "tex",
		"templates":{
			"requirement": "req.tex"
		}
	}
}