diff --git a/gitlab-pages/README.md b/gitlab-pages/README.md index 718146e8b..dfa3507be 100644 --- a/gitlab-pages/README.md +++ b/gitlab-pages/README.md @@ -4,6 +4,11 @@ The website will be available at [http://localhost:3000](http://localhost:3000) -```zsh +To get the website running you want to do the commands: + +``` +cd website +npm run version next +cd .. docker-compose up ``` \ No newline at end of file diff --git a/gitlab-pages/docs/language-basics/cheat-sheet.md b/gitlab-pages/docs/language-basics/cheat-sheet.md index 4d8510cfa..c754d039f 100644 --- a/gitlab-pages/docs/language-basics/cheat-sheet.md +++ b/gitlab-pages/docs/language-basics/cheat-sheet.md @@ -16,6 +16,7 @@ title: Cheat Sheet |Natural numbers | `42n`, `7n`| |Unit| `unit`| |Boolean|
const hasDriversLicense: bool = False;
const adult: bool = True;
|
+|Boolean Logic|(not True) == False == (False and True) == (False or False)
|
|Mutez (micro tez)| `42mtz`, `7mtz` |
|Address | `"tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx"`, `"KT1JepfBfMSqkQyf9B1ndvURghGsSB8YCLMD"`|
|Addition |`3 + 4`, `3n + 4n`|
@@ -26,16 +27,18 @@ title: Cheat Sheet
|Includes|```#include "library.ligo"```|
|Functions (short form)|function add (const a : int ; const b : int) : int is
block { skip } with a + b
|
|Functions (long form)|function add (const a : int ; const b : int) : int is
block {
const result: int = a + b;
} with result
|
+| If Statement | if age < 16
then fail("Too young to drive.");
else const new_id: int = prev_id + 1;
|
|Options|type middleName is option(string);
const middleName : middleName = Some("Foo");
const middleName : middleName = None;
|
|Assignment| ```const age: int = 5;```|
|Assignment on an existing variable type action is
| Increment of int
| Decrement of int
|
|Variant *(pattern)* matching|const a: action = Increment(5);
case a of
| Increment(n) -> n + 1
| Decrement(n) -> n - 1
end
|
|Records|type person is record
age: int ;
name: string ;
end
const john : person = record
age = 18;
name = "John Doe";
end
const name: string = john.name;
|
-|Maps|type prices is map(nat, tez);
const prices : prices = map
10n -> 60mtz;
50n -> 30mtz;
100n -> 10mtz;
end
const price: option(tez) = prices[50n];
|
+|Maps|type prices is map(nat, tez);
const prices : prices = map
10n -> 60mtz;
50n -> 30mtz;
100n -> 10mtz;
end
const price: option(tez) = prices[50n];
prices[200n] := 5mtz;
|
|Contracts & Accounts|const destinationAddress : address = "tz1...";
const contract : contract(unit) = get_contract(destinationAddress);
|
|Transactions|const payment : operation = transaction(unit, amount, receiver);
|
+|Exception/Failure|`fail("Your descriptive error message for the user goes here.")`|
diff --git a/gitlab-pages/docs/language-basics/operators.md b/gitlab-pages/docs/language-basics/operators.md
index 3b2dfda6d..9403a0d92 100644
--- a/gitlab-pages/docs/language-basics/operators.md
+++ b/gitlab-pages/docs/language-basics/operators.md
@@ -11,4 +11,5 @@ title: Operators
|--- |--- |--- |
| `SENDER` | `sender` | Address that initiated the current transaction
| `SOURCE` | `source` | Address that initiated the transaction, which triggered the current transaction. (useful e.g. when there's a transaction sent by another contract)
-| `AMOUNT` | `amount` | Amount of tez sent by the transaction that invoked the contract
\ No newline at end of file
+| `AMOUNT` | `amount` | Amount of tez sent by the transaction that invoked the contract
+| `NOW` | `now` | Timestamp of the block whose validation triggered execution of the contract, i.e. current time when the contract is run.
\ No newline at end of file
diff --git a/gitlab-pages/docs/setup/installation.md b/gitlab-pages/docs/setup/installation.md
index 66cef54bb..c9b5c5503 100644
--- a/gitlab-pages/docs/setup/installation.md
+++ b/gitlab-pages/docs/setup/installation.md
@@ -3,14 +3,19 @@ id: installation
title: Installation
---
-There are currently two ways to get started with Ligo, both of those will allow you to use the Ligo CLI with your contracts. You can choose to use either the Docker image, or to compile & build the Ligo CLI yourself.
+There are currently two ways to get started with Ligo, both of those will allow you to use the Ligo CLI with your contracts. You can choose to use either a Docker image, or to compile & build the Ligo CLI yourself.
## Dockerized installation (recommended)
> 🐳 You can find instructions on how to install Docker [here](https://docs.docker.com/install/).
-Easiest way to use LIGO is through the Docker image available at [Docker Hub](https://hub.docker.com/r/ligolang/ligo). Sources for the image can be found on [Gitlab](https://gitlab.com/ligolang/ligo/blob/dev/docker/Dockerfile).
-You can either run the docker image yourself, or you can setup a global ligo executable as shown below.
+It's easiest to use LIGO through one of its Docker images. You have two options,
+the first is to use our installation script to set up a globally available LIGO
+executable (see below). This manages the Docker bits for you. The second
+is to directly use the Docker image available at [Docker Hub](https://hub.docker.com/r/ligolang/ligo).
+This lets you run multiple versions and keep your installation(s) self contained, but requires more familiarity with Docker.
+Sources for the image can be found on [Gitlab](https://gitlab.com/ligolang/ligo/blob/master/docker/Dockerfile).
+If this is your first time using Docker, you probably want to set up a global ligo executable as shown below.
### Setting up a globally available `ligo` executable
diff --git a/gitlab-pages/docs/tutorials/get-started/tezos-taco-shop-smart-contract.md b/gitlab-pages/docs/tutorials/get-started/tezos-taco-shop-smart-contract.md
index 59970d4a8..079dbb239 100644
--- a/gitlab-pages/docs/tutorials/get-started/tezos-taco-shop-smart-contract.md
+++ b/gitlab-pages/docs/tutorials/get-started/tezos-taco-shop-smart-contract.md
@@ -59,6 +59,8 @@ current_purchase_price = max_price / available_stock
In this tutorial, we'll use LIGO's dockerized version for the sake of simplicity. You can find the installation instructions [here](setup/installation.md#dockerized-installation-recommended).
+The best way to install the dockerized LIGO is as a **global executable** through the installation script, as shown in the screenshot below:
+