mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Removed notes on writing style from metadata doc.
They're now found on the wiki page, the doc's supposed to be the technical details, whereas the wiki page is for how we as a team operate.
This commit is contained in:
@@ -106,21 +106,8 @@ h3{
|
||||
<p>Some important points that are more specific to how BOSS uses YAML:
|
||||
<ul>
|
||||
<li>BOSS's support for YAML syntax is incomplete. A list of known limitations can be found <a href="https://github.com/WrinklyNinja/yaml-cpp/issues?labels=bug&state=open">here</a>. The only major missing piece is support for merge keys (<code><<:</code>).
|
||||
<li>Child data nodes should be indented two spaces from their parents. This isn't a strict requirement, but is the best trade-off between compactness and readability.
|
||||
<li>Strings are case-sensitive, apart from file paths, regular expressions and checksums.
|
||||
<li>Strings should be enclosed in single quotes if they contain any of the following characters: <code>-?:,[]{}#&*!|>"%@`</code>, unless they also contain any single quotes, in which case the string should be enclosed in double quotes instead. This isn't always strictly necessary, but it's better to err on the side of caution. If you really want to only quote strings when absolutely necessary, be sure to check what you write by copy/pasting the whole data structure the string appears into a YAML parser such as <a href="http://nodeca.github.io/js-yaml/">this one</a> and making sure that what it outputs is correct.
|
||||
<li>In a double-quoted string, any backslashes and double quotes (excluding those quoting the whole string) need to be escaped with a backlash, ie. <code>"</code> → <code>\"</code> and <code>\</code> → <code>\\</code>. It's best to avoid using backslashes (except for the purpose of escaping) wherever possible, due to its double meaning. In file paths, a forwardslash can be used instead.
|
||||
<p>For example, the following condition nodes are all equivalent:
|
||||
<ul>
|
||||
<li><code>condition: not file("meshes\Characters\_1stperson.nif")</code>
|
||||
<li><code>condition: 'not file("meshes\Characters\_1stperson.nif")'</code>
|
||||
<li><code>condition: "not file(\"meshes\\Characters\\_1stperson.nif\")"</code>
|
||||
<li><code>condition: not file("meshes/Characters/_1stperson.nif")</code>
|
||||
<li><code>condition: 'not file("meshes/Characters/_1stperson.nif")'</code>
|
||||
<li><code>condition: "not file(\"meshes/Characters/_1stperson.nif\")"</code>
|
||||
</ul>
|
||||
</ul>
|
||||
<p>These docs give all example syntax in YAML's least compact representation: you can also use a more compact representation, but make sure that you do not sacrifice readability when doing so.
|
||||
<p>Some properties of file paths as used by BOSS:
|
||||
<ul>
|
||||
<li>They are evaluated as paths relative to the game's Data folder.
|
||||
@@ -128,7 +115,7 @@ h3{
|
||||
<li>Regular expression file paths must be written in the <a href="http://www.boost.org/doc/libs/1_54_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html">Perl</a> syntax.
|
||||
<li>Only the filename of a regex file path may contain non-literal regex syntax, ie. if the filename part of the regex file path is removed, the remainder must be an exact folder path (though with the regex syntax special characters escaped). For example, given the regex file path <code>Meshes\\Resources(1|2)\\(upperclass)?table.nif</code>, BOSS will look for a file named <code>table.nif</code> or <code>upperclasstable.nif</code> in the <code>Meshes\Resources(1|2)</code> folder, rather than looking in the <code>Meshes\Resources1</code> and <code>Meshes\Resources2</code> folders.
|
||||
</ul>
|
||||
<p>Please test any changes you make before uploading them. One way of doing this is to run BOSS, another is to copy/paste what you've changed into an online parser such as <a href="http://nodeca.github.io/js-yaml/">this one</a>, though it won't catch condition syntax errors or non-syntax errors such as having the same file both required and incompatible.
|
||||
<p>Please test any changes you make before uploading them. One way of doing this is to run BOSS, another is to copy/paste what you've changed into <a href="http://nodeca.github.io/js-yaml/">here</a>, though it won't catch condition syntax errors and doesn't use the same parser as BOSS so may give different results.
|
||||
|
||||
<h2 id="filestruct">Metadata File Contents</h2>
|
||||
<p>The root of a metadata file is a key-value map. BOSS will recognise the following keys, none of which are required:
|
||||
|
||||
Reference in New Issue
Block a user