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

*⚠️ 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;
| -|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: +
Installing the next version of LIGO's CLI
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). diff --git a/gitlab-pages/website/pages/en/index.js b/gitlab-pages/website/pages/en/index.js index 77a161104..f949a6ecd 100644 --- a/gitlab-pages/website/pages/en/index.js +++ b/gitlab-pages/website/pages/en/index.js @@ -97,6 +97,8 @@ class HomeSplash extends React.Component { + +