Skip to content

Commit 5834964

Browse files
committed
Reformatted JSON.md to have one sentence per line
Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
1 parent d94bcb5 commit 5834964

1 file changed

Lines changed: 25 additions & 36 deletions

File tree

JSON.md

Lines changed: 25 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ These are copies of the module directories, where it's more "safe" to do things
223223
## All available build steps
224224

225225
The build steps below manipulate the temporary files in the steps directories and write results to the output policy set, in `out/masterfiles`.
226-
Unless otherwise noted, all steps are run inside the module's folder (`out/steps/...`) with sources / file paths relative to that folder, and targets / destinations mentioned below are relative to the output policy set (`out/masterfiles`, which in the end will be deployed as `/var/cfengine/masterfiles`). In `cfbs.json`'s `"steps"`, the build step name must be separated from the rest of the build step by a regular space.
226+
Unless otherwise noted, all steps are run inside the module's folder (`out/steps/...`) with sources / file paths relative to that folder, and targets / destinations mentioned below are relative to the output policy set (`out/masterfiles`, which in the end will be deployed as `/var/cfengine/masterfiles`).
227+
In `cfbs.json`'s `"steps"`, the build step name must be separated from the rest of the build step by a regular space.
227228

228229
- `copy <source> <destination>`
229230
- Copy a single file or a directory recursively.
@@ -450,11 +451,9 @@ cfbs init && cfbs add https://github.com/cfengine/some-repo
450451

451452
## Modules with input
452453

453-
Some modules allow for users to add module input by responding to questions
454-
expressed under the `"input"` attribute in `cfbs.json`. User input can be added
455-
using the `cfbs input <module-name>` command, which stores responses in
456-
`./<module-name>/input.json`. These responses are translated into augments which
457-
will be added to `./out/masterfiles/def.json` during `cfbs build`.
454+
Some modules allow for users to add module input by responding to questions expressed under the `"input"` attribute in `cfbs.json`.
455+
User input can be added using the `cfbs input <module-name>` command, which stores responses in `./<module-name>/input.json`.
456+
These responses are translated into augments which will be added to `./out/masterfiles/def.json` during `cfbs build`.
458457

459458
### Create single file example
460459

@@ -490,10 +489,8 @@ The `"input"` attribute takes a list of input definitions as illustrated below.
490489
}
491490
```
492491

493-
From the example above, we can see that the `"input"` list contains one input
494-
definition. By running the command `cfbs input create-single-file`, the input
495-
definition will be copied into `./create-single-file/input.json` along with the
496-
user responses.
492+
From the example above, we can see that the `"input"` list contains one input definition.
493+
By running the command `cfbs input create-single-file`, the input definition will be copied into `./create-single-file/input.json` along with the user responses.
497494

498495
```
499496
$ cfbs input create-single-file
@@ -511,10 +508,8 @@ $ cat ./create-single-file/input.json
511508
]
512509
```
513510

514-
By running `cfbs build`, augments will be generated from
515-
`./create-single-file/input.json` and added to `./out/masterfiles/def.json`.
516-
Note that this is dependant on the `"input ./input.json def.json"` build step in
517-
`cfbs.json`.
511+
By running `cfbs build`, augments will be generated from `./create-single-file/input.json` and added to `./out/masterfiles/def.json`.
512+
Note that this is dependent on the `"input ./input.json def.json"` build step in `cfbs.json`.
518513

519514
```
520515
$ cfbs build
@@ -538,13 +533,12 @@ $ cat ./out/masterfiles/def.json
538533
}
539534
```
540535

541-
From the example above we can see our beloved `filename`-variable along with a
542-
class generated by the autorun dependency. Studying our variable closer, we can
543-
see that a namespace, bundle, and a comment, were automatically assigned some
544-
default values. I.e. `cfbs`, the module name canonified, and `Added by 'cfbs
545-
input'` respectivy. These defaults can easily be overridden using the
546-
`namespace`, `bundle`, and `comment` attributes in the variable definition. E.g.
547-
the following variable definition;
536+
From the example above we can see our beloved `filename`-variable along with a class generated by the autorun dependency.
537+
Studying our variable closer, we can see that a namespace, bundle, and a comment, were automatically assigned some default values.
538+
I.e. `cfbs`, the module name canonified, and `Added by 'cfbs
539+
input'` respectively.
540+
These defaults can easily be overridden using the `namespace`, `bundle`, and `comment` attributes in the variable definition.
541+
E.g. the following variable definition;
548542

549543
```json
550544
"input": [
@@ -575,9 +569,8 @@ would produce the following augment;
575569

576570
### Create a single file with content example
577571

578-
A module that creates empty files is not too impressive on its own. Let us
579-
instead try to extend our previous example by having the module also ask for
580-
file contents.
572+
A module that creates empty files is not too impressive on its own.
573+
Let us instead try to extend our previous example by having the module also ask for file contents.
581574

582575
```json
583576
{
@@ -615,9 +608,8 @@ file contents.
615608
}
616609
```
617610

618-
As you can see from the example above, the extension would only require us to
619-
add another variable to the input definition. Let's have a look at the results
620-
from running `cfbs input` with our extension module.
611+
As you can see from the example above, the extension would only require us to add another variable to the input definition.
612+
Let's have a look at the results from running `cfbs input` with our extension module.
621613

622614
```
623615
$ cfbs input create-single-file-with-content
@@ -651,9 +643,9 @@ $ cat ./out/masterfiles/def.json
651643

652644
### Create multiple files example
653645

654-
Sometimes we would like a module to support taking an arbritary number of
655-
inputs. This can be done using a variable definition of type list. Let's extend
656-
our first example from creating a single to multiple files.
646+
Sometimes we would like a module to support taking an arbritary number of inputs.
647+
This can be done using a variable definition of type list.
648+
Let's extend our first example from creating a single to multiple files.
657649

658650
```json
659651
{
@@ -702,8 +694,7 @@ What file should this module create? /tmp/create-multiple-files-2.txt
702694
Do you want to create another file? no
703695
```
704696

705-
The _*./create-multiple-files/input.json*_ file would look similar to the
706-
following JSON:
697+
The _*./create-multiple-files/input.json*_ file would look similar to the following JSON:
707698

708699
```json
709700
[
@@ -725,8 +716,7 @@ following JSON:
725716
]
726717
```
727718

728-
And if we build our project we can expect something similar to the following
729-
output:
719+
And if we build our project we can expect something similar to the following output:
730720

731721
```
732722
$ cfbs build
@@ -755,8 +745,7 @@ $ cat ./out/masterfiles/def.json
755745

756746
### Create multiple files with content example
757747

758-
As a final example, let's see how we can build a module that takes an arbritary
759-
number of filename and content pairs as input.
748+
As a final example, let's see how we can build a module that takes an arbitrary number of filename and content pairs as input.
760749

761750
```json
762751
{

0 commit comments

Comments
 (0)