Home
Keywords
News
Edit
History
Recent changes
New version:
Cuby4
documentation
is here
YAML
New name
Password
Show page
Syntax
Some cuby input files in YAML format can bee seen on [Examples] page. !YAML structures The basic '''keyword'''->value record in cuby input looks like {html}<pre><code>keyword: value</code></pre>{/html} In some cases, cuby uses '''subsections''' in input files to contain keywords specific to some part of the calculation. It is created as a list one level deeper, indented by two spaces: {html}<pre><code>subsection_name: key1: value key2: value another_subsection: key1: different_value key2: value</code></pre>{/html} Third feature of YAML used in cuby input files are '''array'''s - ordered lists values. Array is written in YAML using - characters: {html}<pre><code>keyword_requiring_array: - value1 - value2 - value3 </code></pre>{/html} Some keywords are read as '''comma-separated lists''', but these are not recognized by YAML parser, but processed by cuby itself: {html}<pre><code>keyword: this, that, something else</code></pre>{/html} Empty lines are ignored, # character starts comments. !!Warning! YAML language specification does not allow the use of duplicate keys, but the ruby parser does not complain when it encounters this problems and just overwrites the value. Therefore, input {html}<pre><code>keyword: 1, 2, 3 keyword: 6, 7 </code></pre>{/html} sets the value of the key to "6, 7". !Syntax highlighting And advantage of standardized file format is that there are syntax highligters for it. If one is not a part of your favorite editor and the editor is vim, you can get the highilgter [here|http://github.com/trans/yaml_vim/tree/master]
Password
Edit summary