From ee682ece5d5d39fe71a02259ef17aebd2dd6bfd7 Mon Sep 17 00:00:00 2001 From: Bill Niblock Date: Sat, 6 May 2017 18:06:00 -0400 Subject: [PATCH] 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. --- README.md | 2 -- docs/config_file.md | 66 ++++++++++++++++++++++++++++----------------- 2 files changed, 41 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index af8be4b..2bc1415 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/docs/config_file.md b/docs/config_file.md index bc72f3a..689a591 100644 --- a/docs/config_file.md +++ b/docs/config_file.md @@ -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.