Skip to content

Configuration File: options.yml

Hasan Karahan edited this page Jan 25, 2014 · 6 revisions

Each report needs a configuration file, usually named as options.yml (or any other name with a .yml extension). Without it, NoTex will not be able to translate the report (made of various rST files) to PDF, LaTex or HTML. The file is written in the YAML standard, which is a human friendly way of describing a configuration.

In addition to the default YAML features, it supports string interpolation: That means, that once you define a left-hand side key with a value, then you can use this key on the right-hand side as a placeholder for the value to define other keys, e.g.:

author: 'AUTHORs'
copyright: '${date %Y}, ${author}'

One can set the key author to the value AUTHORs, and later on set the key copyright to ${date %Y} ${author}. Therefore copyright will contain the value 2012, AUTHORs. Using interpolation you can avoid repeating yourself and need to define keys like author only once.

Tags

The example above demonstrates another feature, where you can use pre-defined tags, which represent dynamic content, to set the keys. So ${date %Y} would be 2012 if the current year were 2012, or ${date} would be 2012-05-03 if the current date were May 3rd, 2012. The supported tags are: date, time and datetime whereas the optional argument describes the format you want the date/time to be in; see format options for further information.

Filters

Another feature are pre-defined filters that do some post-processing for a given value: quote makes a value URL friendly and swap exchanges a given argument with another one, e.g.

  • ${My Project|quote} will result in My+Project,
  • ${Your Project|swap Your His} will result in His Project, and
  • ${My Project|swap My His|quote} will result in His+Project.

In configuration files the quote filter may be used, if the back-end cannot handle certain project name values (e.g. such containing a space). Filters can be combined with pre-defined tags and user-defined keys.