Update formatting

- README.md: Remove unnecessary copyright line
- docs/config_file.md: Update the example YAML file to actually be proper.
- docs/config_file.md: Expand information to cover entire configuration file.
This commit is contained in:
Bill Niblock 2017-05-06 18:06:00 -04:00
parent edcccc1869
commit ee682ece5d
2 changed files with 41 additions and 27 deletions

View file

@ -68,5 +68,3 @@ You can contribute to Sapling by following these instructions:
Sapling is licensed under the MIT license. The full text can be found in
[LICENSE](LICENSE).
(c) 2017 Bill Niblock

View file

@ -9,42 +9,58 @@ The configuration file for `sapling` is a standard YAML file. The general
outline looks something like this:
---
trunk:
desc: This is a description of the dialogue tree.
- branch:
-
trunk: "This is a description of the dialogue tree."
-
branch:
number: 1
text: "This is the overall text for the branch."
- leaf: 1
text: "This is option 1."
branch: 2
- leaf: 2
text: "This is option 2."
branch: 3
- branch:
leaf:
-
text: "This is option 1."
branch: 2
-
text: "This is option 2."
branch: 3
-
branch:
number: 2
text: "This is the overall text for the branch."
- leaf: 1
text: "This is option 1, on branch 2!"
branch: 3
- branch:
leaf:
-
text: "This is option 1."
branch: 1
-
text: "This is option 2."
branch: 3
-
branch:
number: 3
text: "This is the overall text for the branch."
- leaf: 1
text: "This is option 3, branch 3"
branch: 0
## Outline
Each branch has the following options:
#### Trunk
- `number`: The branch number. This is a number, but must be unique.
- `text`: The text provided by getting to this branch. The first branch is
shown by default when the tree is opened.
- `leaf`: Each leaf represents an option on the branch. The value of the leaf is
the number of the option shown. For example, `leaf: 1` represents the first
listed option.
The `trunk` is a metadata list. Currently, the only information we really care
about is a general description for the tree. Because of this, `trunk` is the
key, and the description is the value.
Each leaf has the following options:
#### Branch
Branches are the content of a dialogue tree. Each `branch` has the following
options:
- `number`: The branch number. This is how leaves get around. It must be unique.
- `text`: The text provided by getting to this branch. The first branch is shown
by default when the tree is opened.
- `leaf`: [Optional] The list of options for the branch. Details for leaves are
below. If no leaves are provided, the branch is considered a "terminal
branch", and the program will end after reaching it.
#### Leaf
Leaves are the options of a branch. Each `leaf` has the following options:
- `text`: The text shown as the option.
- `branch`: The branch this option takes the user to.