From b7f11e681643721dae220904a152b28ba2d9cc83 Mon Sep 17 00:00:00 2001 From: Qi Xiao Date: Wed, 24 Apr 2019 20:38:12 +0100 Subject: [PATCH] _website: Fix Elvish codeblocks. --- _website/ref/language.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/_website/ref/language.md b/_website/ref/language.md index 469280c4..ade8a160 100644 --- a/_website/ref/language.md +++ b/_website/ref/language.md @@ -1228,7 +1228,7 @@ executed. The condition part is an expression, not a command like in other shells. Example: -```elvish-transcript +```elvish fn tell-language [fname]{ if (has-suffix $fname .go) { echo $fname" is a Go file!" @@ -1237,12 +1237,13 @@ fn tell-language [fname]{ } else { echo $fname" is a mysterious file!" } +} ``` The condition part must be syntactically a single expression, but it can evaluate to multiple values, in which case they are and'ed: -```elvish-transcript +```elvish if (put $true $false) { echo "will not be executed" } @@ -1253,7 +1254,7 @@ how `and` works. Tip: a combination of `if` and `?()` gives you a semantics close to other shells: -```elvish-transcript +```elvish if ?(test -d .git) { # do something }