From 251a6a2b580158b5dfb34e8b08b10071e6353c1a Mon Sep 17 00:00:00 2001 From: Dean Coakley <dean.s.coakley@gmail.com> Date: Fri, 1 Feb 2019 05:32:40 +0000 Subject: [PATCH] Fix code syntax highlighting in docs (#5245) * Added yaml to undelcared code blocks * Changed YAML->yaml for consistency * Added console syntax highlighting Signed-off-by: Dean Coakley <dean.s.coakley@gmail.com> --- docs/chart_template_guide/control_structures.md | 6 +++--- docs/chart_template_guide/debugging.md | 4 ++-- docs/chart_template_guide/functions_and_pipelines.md | 4 ++-- docs/chart_template_guide/values_files.md | 4 ++-- docs/chart_template_guide/yaml_techniques.md | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/chart_template_guide/control_structures.md b/docs/chart_template_guide/control_structures.md index 61d9ef9e2..68820dfa7 100644 --- a/docs/chart_template_guide/control_structures.md +++ b/docs/chart_template_guide/control_structures.md @@ -20,7 +20,7 @@ The first control structure we'll look at is for conditionally including blocks The basic structure for a conditional looks like this: -``` +```yaml {{ if PIPELINE }} # Do something {{ else if OTHER PIPELINE }} @@ -115,7 +115,7 @@ data: `mug` is incorrectly indented. Let's simply out-dent that one line, and re-run: -``` +```yaml apiVersion: v1 kind: ConfigMap metadata: @@ -224,7 +224,7 @@ The next control structure to look at is the `with` action. This controls variab The syntax for `with` is similar to a simple `if` statement: -``` +```yaml {{ with PIPELINE }} # restricted scope {{ end }} diff --git a/docs/chart_template_guide/debugging.md b/docs/chart_template_guide/debugging.md index fac788cc4..23a6ae70b 100644 --- a/docs/chart_template_guide/debugging.md +++ b/docs/chart_template_guide/debugging.md @@ -12,7 +12,7 @@ When your YAML is failing to parse, but you want to see what is generated, one easy way to retrieve the YAML is to comment out the problem section in the template, and then re-run `helm install --dry-run --debug`: -```YAML +```yaml apiVersion: v1 # some: problem section # {{ .Values.foo | quote }} @@ -20,7 +20,7 @@ apiVersion: v1 The above will be rendered and returned with the comments intact: -```YAML +```yaml apiVersion: v1 # some: problem section # "bar" diff --git a/docs/chart_template_guide/functions_and_pipelines.md b/docs/chart_template_guide/functions_and_pipelines.md index 66176fc59..fe9c92d6e 100644 --- a/docs/chart_template_guide/functions_and_pipelines.md +++ b/docs/chart_template_guide/functions_and_pipelines.md @@ -4,7 +4,7 @@ So far, we've seen how to place information into a template. But that informatio Let's start with a best practice: When injecting strings from the `.Values` object into the template, we ought to quote these strings. We can do that by calling the `quote` function in the template directive: -``` +```yaml apiVersion: v1 kind: ConfigMap metadata: @@ -104,7 +104,7 @@ drink: {{ .Values.favorite.drink | default "tea" | quote }} If we run this as normal, we'll get our `coffee`: -``` +```yaml # Source: mychart/templates/configmap.yaml apiVersion: v1 kind: ConfigMap diff --git a/docs/chart_template_guide/values_files.md b/docs/chart_template_guide/values_files.md index a15047667..218da19dc 100644 --- a/docs/chart_template_guide/values_files.md +++ b/docs/chart_template_guide/values_files.md @@ -54,7 +54,7 @@ data: Because `favoriteDrink` is set in the default `values.yaml` file to `coffee`, that's the value displayed in the template. We can easily override that by adding a `--set` flag in our call to `helm install`: -``` +```console helm install --dry-run --debug --set favoriteDrink=slurm ./mychart SERVER: "localhost:44134" CHART PATH: /Users/mattbutcher/Code/Go/src/k8s.io/helm/_scratch/mychart @@ -85,7 +85,7 @@ favorite: Now we would have to modify the template slightly: -``` +```yaml apiVersion: v1 kind: ConfigMap metadata: diff --git a/docs/chart_template_guide/yaml_techniques.md b/docs/chart_template_guide/yaml_techniques.md index 44c41f903..00b33b674 100644 --- a/docs/chart_template_guide/yaml_techniques.md +++ b/docs/chart_template_guide/yaml_techniques.md @@ -177,7 +177,7 @@ Now the value of `coffee` will be `Latte\nCappuccino\nEspresso\n\n\n`. Indentation inside of a text block is preserved, and results in the preservation of line breaks, too: -``` +```yaml coffee: |- Latte 12 oz @@ -336,7 +336,7 @@ reference is expanded and then discarded. So if we were to decode and then re-encode the example above, the resulting YAML would be: -```YAML +```yaml coffee: yes, please favorite: Cappucino coffees: -- GitLab