From 95dca87f49bd62182c5626a6d4096e09d2068600 Mon Sep 17 00:00:00 2001 From: ADTC Date: Fri, 5 Mar 2021 02:53:01 +0800 Subject: [PATCH 1/3] Make the documentation for increment/decrement clearer The increment and decrement tags are special in that they would output or echo the variable's final value onto the page (or whatever output sink you're using). This needs to be mentioned in the documentation. Please see Shopify#1399 for more info and discussion. --- _tags/variable.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_tags/variable.md b/_tags/variable.md index 612778a..95d0a36 100644 --- a/_tags/variable.md +++ b/_tags/variable.md @@ -79,7 +79,7 @@ I am 35 and my favourite food is pizza. ## increment -Creates a new number variable, and increases its value by one every time it is called. The initial value is 0. +Creates and outputs a new number variable. On subsequent calls, it increases its value by one and outputs the new value. The initial value is 0.

Input

```liquid @@ -122,7 +122,7 @@ In the example below, a variable named "var" is created through `assign`. The `i ## decrement -Creates a new number variable, and decreases its value by one every time it is called. The initial value is -1. +Creates and outputs a new number variable. On subsequent calls, it decreases its value by one and outputs the new value. The initial value is -1.

Input

```liquid From c63fcdfe0ab3acc14d7e281ff4060fd1b5663b25 Mon Sep 17 00:00:00 2001 From: ADTC Date: Fri, 5 Mar 2021 04:14:17 +0800 Subject: [PATCH 2/3] Apply suggestions from code review May as well keep the description of the initial render of the tag together. Co-authored-by: Dylan Thacker-Smith --- _tags/variable.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_tags/variable.md b/_tags/variable.md index 95d0a36..936a2ee 100644 --- a/_tags/variable.md +++ b/_tags/variable.md @@ -79,7 +79,7 @@ I am 35 and my favourite food is pizza. ## increment -Creates and outputs a new number variable. On subsequent calls, it increases its value by one and outputs the new value. The initial value is 0. +Creates and outputs a new number variable with initial value 0. On subsequent calls, it increases its value by one and outputs the new value.

Input

```liquid @@ -122,7 +122,7 @@ In the example below, a variable named "var" is created through `assign`. The `i ## decrement -Creates and outputs a new number variable. On subsequent calls, it decreases its value by one and outputs the new value. The initial value is -1. +Creates and outputs a new number variable with initial value -1. On subsequent calls, it decreases its value by one and outputs the new value.

Input

```liquid From 506df22f41b1a037cac436180f9774a7ad568fae Mon Sep 17 00:00:00 2001 From: ADTC Date: Fri, 5 Mar 2021 04:17:45 +0800 Subject: [PATCH 3/3] Put the initial values into a code container It looks better and more readable this way. --- _tags/variable.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_tags/variable.md b/_tags/variable.md index 936a2ee..062f38f 100644 --- a/_tags/variable.md +++ b/_tags/variable.md @@ -79,7 +79,7 @@ I am 35 and my favourite food is pizza. ## increment -Creates and outputs a new number variable with initial value 0. On subsequent calls, it increases its value by one and outputs the new value. +Creates and outputs a new number variable with initial value `0`. On subsequent calls, it increases its value by one and outputs the new value.

Input

```liquid @@ -122,7 +122,7 @@ In the example below, a variable named "var" is created through `assign`. The `i ## decrement -Creates and outputs a new number variable with initial value -1. On subsequent calls, it decreases its value by one and outputs the new value. +Creates and outputs a new number variable with initial value `-1`. On subsequent calls, it decreases its value by one and outputs the new value.

Input

```liquid