Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/yamlp.git

Updated documentation

AuthorDave Jarvis <email>
Date2019-07-04 14:31:21 GMT-0700
Commit7dbbbe52dd05edd70bdc6e3976bd3757dcbd9e3e
Parentc5b1116
README.md
# YAMLP
-YAMLP is a pre-processor for YAML. Given a YAML file with delimited
-references such as:
+YAMLP is a preprocessor for YAML. Given a YAML file with delimited references such as:
---
- a: A
- b: $a$ B
+ a: A
+ b: $a$ B
c: $b$ C $b$
- ...
+ d: $a$ $b$ $c$ D $a$
+ e:
+ f:
+ g: G
+ h: H and $e.f.g$
-This will write a new YAML file to standard output with the references
-substituted using corresponding YAML path values from within the document:
+This will write a new YAML file to standard output with the references substituted using corresponding YAML path values from within the document:
---
- a: A
- b: A B
- c: A B C A B
- ...
+ a: "A"
+ b: "A B"
+ c: "A B C A B"
+ d: "A A B A B C A B D A"
+ e:
+ f:
+ g: "G"
+ h: "H and G"
-This is similar to the template mechanism used by [pandoc](http://pandoc.org/)
-with the addition of recursive delimited references.
-# Usage
+This is similar to the template mechanism used by [pandoc](http://pandoc.org/) with the addition of recursive delimited references.
-Use the application as follows:
+# Requirements
- java -jar yamlp.jar --input variables.yaml > v.yaml
+Install
-Be careful not to overwrite your original YAML files.
+* [Java Development Kit](https://openjdk.java.net/install) 1.8.0 (or newer)
+* [Apache Maven](https://maven.apache.org/) 3.6.0 (or newer)
-# Errors
+# Build
-Missing delimited references are written to standard error.
+Build the project as follows:
-# Options
+ mkdir -p $HOME/dev/java
+ cd $HOME/dev/java
+ git clone https://bitbucket.org/djarvis/yamlp
+ cd yamlp
+ mvn package
-This section describes common command line arguments. Without supplying any
-arguments, the full list of options and descriptions are given.
-## Required
+The file `target/yamlp.jar` is built.
-* `--input` - path to the YAML file to process.
+# Install
-## Optional
+Install the program by copying it into a directory. For example:
-* `--variables` - write all references to standard error.
-* `--quiet` - suppress writing missing references to standard error.
+ mkdir -p $HOME/bin
+ cp target/yamlp.jar $HOME/bin
+
+
+The file `yamlp.jar` is installed into `$HOME/bin`.
+
+# Usage
+
+Example usages:
+
+ java -jar $HONE/bin/yamlp.jar < variables.yaml > processed.yaml
+ java -jar $HONE/bin/yamlp.jar --xml < variables.yaml > processed.xml
+ java -jar $HONE/bin/yamlp.jar --json < variables.yaml > processed.json
+
+
+These examples show to to run the YAML preprocessor, reading a file from standard input (e.g., `variables.yaml`) and writing the processed version of the file to standard output (e.g., `processed.yaml`).
+
+# Options
+
+This section describes common command line arguments. Without supplying any arguments, the full list of options and descriptions are given.
+
+* `--input` - path to the YAML file to process (standard input)
+* `--json` - export contents in JSON format
+* `--xml` - export contents in XML format
+* `--regex` - set expression for matching variables (`(\\$(.*?)\\$)`)
+* `--separator` - set the separator for delimited paths (`.`)
+* `--variables` - output variables to standard error
+* `--quiet` - suppress writing missing references to standard error
+
+# Errors
+
+Missing delimited references are written to standard error.
target/yamlp.jar
Binary files differ
variables.yaml
c: $b$ C $b$
d: $a$ $b$ $c$ D $a$
+e:
+ f:
+ g: G
+h: H and $e.f.g$
+
Delta69 lines added, 27 lines removed, 42-line increase