From afa0e749e393766a04da937dff12f218fe17ccc7 Mon Sep 17 00:00:00 2001 From: John David Pressman Date: Tue, 9 Jul 2019 02:29:24 -0700 Subject: [PATCH 01/12] Add boolean logic, fail() and if conditional to cheat sheet --- gitlab-pages/docs/language-basics/cheat-sheet.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gitlab-pages/docs/language-basics/cheat-sheet.md b/gitlab-pages/docs/language-basics/cheat-sheet.md index 4d8510cfa..58e214dc2 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,6 +27,7 @@ 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

*⚠️ This feature is not supported at the top-level scope, you can use it e.g. within functions. Works for Records and Maps as well.*| ```age := 18;```, ```p.age := 21``` | @@ -36,6 +38,7 @@ title: Cheat Sheet |Maps|
type prices is map(nat, tez);

const prices : prices = map
  10n -> 60mtz;
  50n -> 30mtz;
  100n -> 10mtz;
end

const price: option(tez) = prices[50n];
| |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.")`| From 4ce51f79595da9653e36fb356033aef3ca649133 Mon Sep 17 00:00:00 2001 From: John David Pressman Date: Tue, 9 Jul 2019 18:18:59 -0700 Subject: [PATCH 02/12] Add map assignment to cheat sheet --- gitlab-pages/docs/language-basics/cheat-sheet.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gitlab-pages/docs/language-basics/cheat-sheet.md b/gitlab-pages/docs/language-basics/cheat-sheet.md index 58e214dc2..801dce954 100644 --- a/gitlab-pages/docs/language-basics/cheat-sheet.md +++ b/gitlab-pages/docs/language-basics/cheat-sheet.md @@ -35,7 +35,8 @@ title: Cheat Sheet |Variants|
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];
| +<<<<<<< HEAD +|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.")`| From ece387323049d31294d0eb5bb00fae13f6707175 Mon Sep 17 00:00:00 2001 From: John David Pressman Date: Tue, 9 Jul 2019 19:13:33 -0700 Subject: [PATCH 03/12] Add how to get the time to the operators page --- gitlab-pages/docs/language-basics/operators.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 From 5c7d9fd5512a7e24c36fe459831c3ee7631781e3 Mon Sep 17 00:00:00 2001 From: John David Pressman Date: Tue, 9 Jul 2019 19:27:01 -0700 Subject: [PATCH 04/12] Fix broken link to tutorials on front page of ligolang site --- gitlab-pages/website/pages/en/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gitlab-pages/website/pages/en/index.js b/gitlab-pages/website/pages/en/index.js index 77a161104..f7ced2fe3 100644 --- a/gitlab-pages/website/pages/en/index.js +++ b/gitlab-pages/website/pages/en/index.js @@ -95,8 +95,13 @@ class HomeSplash extends React.Component {
+<<<<<<< HEAD +======= + + +>>>>>>> Fix broken link to tutorials on front page of ligolang site
From b023bff8873501f48016b6814f7248fae1e4d234 Mon Sep 17 00:00:00 2001 From: John David Pressman Date: Tue, 9 Jul 2019 19:53:29 -0700 Subject: [PATCH 05/12] Add clarification on "dockerized LIGO" to taco shop tutorial --- .../tutorials/get-started/tezos-taco-shop-smart-contract.md | 2 ++ 1 file changed, 2 insertions(+) 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: +
Installing the next version of LIGO's CLI
From dc5e3328a2ff9dcd57067a9c899b28373ab56808 Mon Sep 17 00:00:00 2001 From: John David Pressman Date: Tue, 9 Jul 2019 20:01:27 -0700 Subject: [PATCH 06/12] Fix links to ligolang.org and Discord server at bottom of public launch post --- gitlab-pages/website/blog/2019-06-13-public-launch-of-ligo.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitlab-pages/website/blog/2019-06-13-public-launch-of-ligo.md b/gitlab-pages/website/blog/2019-06-13-public-launch-of-ligo.md index f0caa55b8..c59729ff7 100644 --- a/gitlab-pages/website/blog/2019-06-13-public-launch-of-ligo.md +++ b/gitlab-pages/website/blog/2019-06-13-public-launch-of-ligo.md @@ -95,7 +95,7 @@ We are looking to develop a Super Type System that has the following features: The current version explicitly excludes non-essential features which can produce unexpected explosions in gas costs. To alleviate this constraint, we plan to integrate gas benchmarks on all top-level declarations with some fuzzing. This will allow developers and users to estimate the cost of their contracts in real time. ## Getting Started and Contact -Come visit [our website](ligolang.org)! You can also join our [Discord](https://discord.gg/CmTwFM), Riot (*#ligo-public:matrix.org*) or Telegram Chat (Ligo Public channel). +Come visit [our website](https://ligolang.org)! You can also join our [Discord](https://discord.gg/9rhYaEt), Riot (*#ligo-public:matrix.org*) or Telegram Chat (Ligo Public channel). From 8a2a1533c6083150f55e1fcd66823ed118098354 Mon Sep 17 00:00:00 2001 From: John David Pressman Date: Tue, 9 Jul 2019 20:05:33 -0700 Subject: [PATCH 07/12] s/Annotations/Type Annotations/, to make it clearer what that feature is while skimming --- gitlab-pages/docs/language-basics/cheat-sheet.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitlab-pages/docs/language-basics/cheat-sheet.md b/gitlab-pages/docs/language-basics/cheat-sheet.md index 801dce954..032837caa 100644 --- a/gitlab-pages/docs/language-basics/cheat-sheet.md +++ b/gitlab-pages/docs/language-basics/cheat-sheet.md @@ -31,7 +31,7 @@ title: Cheat Sheet |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

*⚠️ This feature is not supported at the top-level scope, you can use it e.g. within functions. Works for Records and Maps as well.*| ```age := 18;```, ```p.age := 21``` | -|Annotations| ```("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address)```| +|Type Annotations| ```("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address)```| |Variants|
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;
| From a891c77d47a65576b99da14102de3c498d91ab42 Mon Sep 17 00:00:00 2001 From: John David Pressman Date: Tue, 9 Jul 2019 20:15:56 -0700 Subject: [PATCH 08/12] Add updated instructions for running/building the website --- gitlab-pages/README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 From 4f7162002c53f6cae3a66ebf9c758259dfb8e9da Mon Sep 17 00:00:00 2001 From: John David Pressman Date: Wed, 10 Jul 2019 00:28:25 -0700 Subject: [PATCH 09/12] Edit installation instructions to emphasize that Docker newbs should use the install script --- gitlab-pages/docs/setup/installation.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gitlab-pages/docs/setup/installation.md b/gitlab-pages/docs/setup/installation.md index 66cef54bb..a43ae9809 100644 --- a/gitlab-pages/docs/setup/installation.md +++ b/gitlab-pages/docs/setup/installation.md @@ -9,8 +9,18 @@ There are currently two ways to get started with Ligo, both of those will allow > 🐳 You can find instructions on how to install Docker [here](https://docs.docker.com/install/). +<<<<<<< HEAD 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. +>>>>>>> Edit installation instructions to emphasize that Docker newbs should use the install script ### Setting up a globally available `ligo` executable From 0ad395a4ed7ed1b09280a88c332ab1aae20b2739 Mon Sep 17 00:00:00 2001 From: John David Pressman Date: Wed, 10 Jul 2019 00:44:44 -0700 Subject: [PATCH 10/12] Minor addition to last commit --- gitlab-pages/docs/setup/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitlab-pages/docs/setup/installation.md b/gitlab-pages/docs/setup/installation.md index a43ae9809..633b1e67d 100644 --- a/gitlab-pages/docs/setup/installation.md +++ b/gitlab-pages/docs/setup/installation.md @@ -3,7 +3,7 @@ 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) From 9cc2a7a0c9c875182d61e8eca6e3da6e75354e49 Mon Sep 17 00:00:00 2001 From: John David Pressman Date: Fri, 2 Aug 2019 17:15:34 -0700 Subject: [PATCH 11/12] Remove uncleared merge conflict marks --- gitlab-pages/docs/language-basics/cheat-sheet.md | 1 - gitlab-pages/docs/setup/installation.md | 5 ----- 2 files changed, 6 deletions(-) diff --git a/gitlab-pages/docs/language-basics/cheat-sheet.md b/gitlab-pages/docs/language-basics/cheat-sheet.md index 032837caa..c754d039f 100644 --- a/gitlab-pages/docs/language-basics/cheat-sheet.md +++ b/gitlab-pages/docs/language-basics/cheat-sheet.md @@ -35,7 +35,6 @@ title: Cheat Sheet |Variants|
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;
| -<<<<<<< HEAD |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);
| diff --git a/gitlab-pages/docs/setup/installation.md b/gitlab-pages/docs/setup/installation.md index 633b1e67d..c9b5c5503 100644 --- a/gitlab-pages/docs/setup/installation.md +++ b/gitlab-pages/docs/setup/installation.md @@ -9,10 +9,6 @@ There are currently two ways to get started with Ligo, both of those will allow > 🐳 You can find instructions on how to install Docker [here](https://docs.docker.com/install/). -<<<<<<< HEAD -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 @@ -20,7 +16,6 @@ is to directly use the Docker image available at [Docker Hub](https://hub.docker 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. ->>>>>>> Edit installation instructions to emphasize that Docker newbs should use the install script ### Setting up a globally available `ligo` executable From 6e3ee8f5fa9943b292b35d2df62aaeeef0a54d2e Mon Sep 17 00:00:00 2001 From: John David Pressman Date: Mon, 5 Aug 2019 17:47:38 -0700 Subject: [PATCH 12/12] Remove undeleted merge conflict markers on homepage --- gitlab-pages/website/pages/en/index.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/gitlab-pages/website/pages/en/index.js b/gitlab-pages/website/pages/en/index.js index f7ced2fe3..f949a6ecd 100644 --- a/gitlab-pages/website/pages/en/index.js +++ b/gitlab-pages/website/pages/en/index.js @@ -95,13 +95,10 @@ class HomeSplash extends React.Component {
-<<<<<<< HEAD -======= ->>>>>>> Fix broken link to tutorials on front page of ligolang site