diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..ccf03db24 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +dist +_opam +_build +docker +gitlab-pages +Makefile \ No newline at end of file diff --git a/.gitignore b/.gitignore index 9053b2cbf..682093b54 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,4 @@ cache/* Version.ml /_opam/ /*.pp.ligo -**/.DS_Store \ No newline at end of file +**/.DS_Store diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1fa3cd9ec..9589ea238 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,12 +1,27 @@ # TODO: remove this as submodules aren't used anymore. variables: GIT_SUBMODULE_STRATEGY: recursive + build_binary_script: "./scripts/distribution/generic/build.sh" + package_binary_script: "./scripts/distribution/generic/package.sh" stages: - build_docker - - build_and_deploy_docker - - build_and_deploy_website - test + - build_and_deploy_docker + - build_and_package_binaries + - build_and_deploy_website + +.build_binary: &build_binary + stage: build_and_package_binaries + script: + - $build_binary_script "$target_os_family" "$target_os" "$target_os_version" + - $package_binary_script "$target_os_family" "$target_os" "$target_os_version" + artifacts: + paths: + - dist/package/**/* + only: + - master + - dev .website_build: &website_build stage: build_and_deploy_website @@ -28,6 +43,9 @@ stages: # build with odoc - dune build @doc + # copy .deb packages into website + - find dist -name \*.deb -exec sh -c 'cp {} gitlab-pages/website/static/deb/ligo_$(basename $(dirname {})).deb' \; + # npm - cd gitlab-pages/website - npm install @@ -71,30 +89,12 @@ local-dune-job: - scripts/build_ligo_local.sh - dune build @ligo-test -remote-repo-job: - <<: *before_script - stage: test - script: - # Add repository - - opam repository add ligo-repository https://gitlab.com/ligolang/ligo.git - - eval $(opam config env) - - opam install -y ligo - # Used in the IDE - #- opam install -y user-setup - #- opam install -y merlin - #- opam install -y ocp-indent - #- opam user-setup install - only: - - master - -# TODO: uncomment this - # Run a docker build without publishing to the registry build-current-docker-image: stage: build_docker <<: *docker script: - - docker build -t $LIGO_REGISTRY_IMAGE:next -f ./docker/Dockerfile . + - sh scripts/build_docker_image.sh - sh scripts/test_cli.sh except: - master @@ -106,13 +106,51 @@ build-and-publish-latest-docker-image: stage: build_and_deploy_docker <<: *docker script: - - docker build -t $LIGO_REGISTRY_IMAGE:next -f ./docker/Dockerfile . + - sh scripts/build_docker_image.sh - sh scripts/test_cli.sh - docker login -u $LIGO_REGISTRY_USER -p $LIGO_REGISTRY_PASSWORD - docker push $LIGO_REGISTRY_IMAGE:next only: - dev +# It'd be a good idea to generate those jobs dynamically, +# based on desired targets +build-and-package-debian-9: + <<: *docker + stage: build_and_package_binaries + variables: + target_os_family: "debian" + target_os: "debian" + target_os_version: "9" + <<: *build_binary + +build-and-package-debian-10: + <<: *docker + stage: build_and_package_binaries + variables: + target_os_family: "debian" + target_os: "debian" + target_os_version: "10" + <<: *build_binary + +build-and-package-ubuntu-18-04: + <<: *docker + stage: build_and_package_binaries + variables: + target_os_family: "debian" + target_os: "ubuntu" + target_os_version: "18.04" + <<: *build_binary + +build-and-package-ubuntu-19-04: + <<: *docker + stage: build_and_package_binaries + variables: + target_os_family: "debian" + target_os: "ubuntu" + target_os_version: "19.04" + <<: *build_binary + # Pages are deployed from both master & dev, be careful not to override 'next' # in case something gets merged into 'dev' while releasing. pages: diff --git a/Makefile b/Makefile index b11ce6fd8..40204f5c8 100644 --- a/Makefile +++ b/Makefile @@ -13,8 +13,9 @@ build-deps: export PATH="/usr/local/bin$${PATH:+:}$${PATH:-}" # Create opam dev switch locally for use with Ligo, add merlin/etc if [ -n "`opam switch show | grep -P ".+/ligo"`" ]; - then :; else scripts/setup_dev_switch.sh; + then :; else scripts/setup_switch.sh; fi + scripts/setup_repos.sh eval $$(opam config env) # Install OCaml build dependencies for Ligo scripts/install_vendors_deps.sh diff --git a/dist/.gitignore b/dist/.gitignore new file mode 100644 index 000000000..86d0cb272 --- /dev/null +++ b/dist/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore \ No newline at end of file diff --git a/docker/distribution/debian/distribute.Dockerfile b/docker/distribution/debian/distribute.Dockerfile new file mode 100644 index 000000000..e69de29bb diff --git a/docker/distribution/debian/package.Dockerfile b/docker/distribution/debian/package.Dockerfile new file mode 100644 index 000000000..440496521 --- /dev/null +++ b/docker/distribution/debian/package.Dockerfile @@ -0,0 +1,32 @@ +ARG targetBuildImage +FROM ${targetBuildImage} +ARG version + +RUN apt-get update -qq +RUN apt-get -y -qq install \ + dput \ + devscripts + +RUN mkdir /package && mkdir /package/bin && mkdir /package/DEBIAN && mkdir /package/dist +# @TODO: make the binary path configurable +RUN cp /home/opam/.opam/4.07/bin/ligo /package/bin/ligo + +# @TODO: inherit version (and other details) from the ligo opam package definition +# In our case we're using the version field to name our package accordingly, +# however this is most likely not ideal +# Also, the architecture field should not be 'all' but rather specific instead. +RUN echo "Package: ligo\n\ +Version: $version\n\ +Architecture: all\n\ +Maintainer: info@ligolang.org\n\ +Depends: libev-dev, perl, pkg-config, libgmp-dev, libhidapi-dev, m4, libcap-dev, bubblewrap, rsync\n\ +Homepage: http://ligolang.org\n\ +Description: LIGO is a statically typed high-level smart-contract language that compiles down to Michelson." >> /package/DEBIAN/control + +RUN cd /package/dist && dpkg-deb --build /package . + +# Test the package +# Optionally this could/should be done in a more pristine docker environment - in a separate image +RUN apt-get update -qq +RUN apt-get -y -f install "/package/dist/$(ls /package/dist)" +RUN ligo --help \ No newline at end of file diff --git a/docker/Dockerfile b/docker/distribution/generic/build.Dockerfile similarity index 81% rename from docker/Dockerfile rename to docker/distribution/generic/build.Dockerfile index 057bd6436..e183fc683 100644 --- a/docker/Dockerfile +++ b/docker/distribution/generic/build.Dockerfile @@ -1,5 +1,7 @@ -# At the moment, this really means 4.07.1 -FROM ocaml/opam2:4.07 +ARG target +FROM ocaml/opam2:${target} + +RUN opam switch 4.07 && eval $(opam env) USER root @@ -10,7 +12,6 @@ USER root # because the currently checkout out version (from git) will be used # to build the image ADD . /ligo - # Set the current working directory to /ligo for # the upcoming scripts WORKDIR /ligo @@ -18,10 +19,6 @@ WORKDIR /ligo # Install required native dependencies RUN sh scripts/install_native_dependencies.sh -# Install OPAM -# TODO: or scripts/install_build_environment.sh ? -RUN sh scripts/install_opam.sh - # Add tezos repository RUN sh scripts/setup_repos.sh diff --git a/gitlab-pages/.gitignore b/gitlab-pages/.gitignore index 7dbdd7e15..66c160e49 100644 --- a/gitlab-pages/.gitignore +++ b/gitlab-pages/.gitignore @@ -1,4 +1,5 @@ **/.DS_Store +.DS_Store node_modules diff --git a/gitlab-pages/docs/language-basics/entrypoints.md b/gitlab-pages/docs/language-basics/entrypoints.md index e666f8c10..30ba46b65 100644 --- a/gitlab-pages/docs/language-basics/entrypoints.md +++ b/gitlab-pages/docs/language-basics/entrypoints.md @@ -13,7 +13,7 @@ Contract below is effectively an empty contract, that takes a `unit` as a parame -```Pascal +```pascaligo function main (const p : unit ; const s : unit) : (list(operation) * unit) is block {skip} with ((nil : list(operation)), s) ``` @@ -27,7 +27,7 @@ In the example below we have a simple counter contract, that can be either `Incr -```Pascal +```pascaligo // variant defining pseudo multi-entrypoint actions type action is | Increment of int diff --git a/gitlab-pages/docs/language-basics/functions.md b/gitlab-pages/docs/language-basics/functions.md index fc6895383..15574aea0 100644 --- a/gitlab-pages/docs/language-basics/functions.md +++ b/gitlab-pages/docs/language-basics/functions.md @@ -9,7 +9,7 @@ Body of a function consists of two parts, the first part (**`block {}`** or **`b -```Pascal +```pascaligo const availableSupply: nat = 15n; const totalSupply: nat = 100n; @@ -30,7 +30,7 @@ A short hand syntax for the same function as above can inline the price calculat While this approach can have it's benefits, it can decrease readability. -```Pascal +```pascaligo const availableSupply: nat = 15n; const totalSupply: nat = 100n; diff --git a/gitlab-pages/docs/language-basics/types.md b/gitlab-pages/docs/language-basics/types.md index 1de9076ab..957b6b6c8 100644 --- a/gitlab-pages/docs/language-basics/types.md +++ b/gitlab-pages/docs/language-basics/types.md @@ -13,7 +13,7 @@ Type aliasing is a great choice when working towards a readable / maintainable s -```Pascal +```pascaligo type animalBreed is string; const dogBreed: animalBreed = "Saluki"; @@ -26,7 +26,7 @@ const dogBreed: animalBreed = "Saluki"; ### Simple types -```Pascal +```pascaligo // accountBalances is a simple type, a map of address <-> tez type accountBalances is map(address, tez); @@ -46,7 +46,7 @@ In the example below you can see definition of data types for a ledger, that kee -```Pascal +```pascaligo // alias two types type account is address; type numberOfTransactions is nat; diff --git a/gitlab-pages/docs/setup/installation.md b/gitlab-pages/docs/setup/installation.md index c9b5c5503..280fd144f 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 a Docker image, or to compile & build the Ligo CLI yourself. +There are currently two ways to get started with Ligo. You can choose to either use a Docker image, or to install packages for your Debian Linux distribution. ## Dockerized installation (recommended) @@ -21,6 +21,8 @@ If this is your first time using Docker, you probably want to set up a global li > You can install additional ligo versions by replacing `next` with the required version number +Download the latest binaries here: https://gitlab.com/ligolang/ligo/pipelines/85536879/builds or get the latest pre-release: + ```zsh # next (pre-release) curl https://gitlab.com/ligolang/ligo/raw/dev/scripts/installer.sh | bash -s "next" @@ -38,6 +40,12 @@ ligo --help ``` -## Manual installation (advanced) +## Debian Linux package installation + +We have produced .deb packages for a few Debian Linuxes. They will install a global `ligo` executable. You can install them in the usual way. + +- [Ubuntu 18.04](/deb/ligo_ubuntu-18.04.deb) +- [Ubuntu 19.04](/deb/ligo_ubuntu-19.04.deb) +- [Debian 9](/deb/ligo_debian-9.deb) +- [Debian 10](/deb/ligo_debian-10.deb) -For now, please refer to the steps described in the [Dockerfile](https://gitlab.com/ligolang/ligo/blob/master/docker/Dockerfile). \ No newline at end of file diff --git a/gitlab-pages/docs/tutorials/get-started/tezos-taco-shop-payout.md b/gitlab-pages/docs/tutorials/get-started/tezos-taco-shop-payout.md index f22f59452..f0d70fe4a 100644 --- a/gitlab-pages/docs/tutorials/get-started/tezos-taco-shop-payout.md +++ b/gitlab-pages/docs/tutorials/get-started/tezos-taco-shop-payout.md @@ -17,14 +17,15 @@ In the [previous tutorial](tutorials/get-started/tezos-taco-shop-smart-contract. ## Analyzing the current contract ### **`taco-shop.ligo`** -``` +```pascaligo type taco_supply is record current_stock : nat; max_price : tez; end type taco_shop_storage is map(nat, taco_supply); -function buy_taco (const taco_kind_index: nat ; var taco_shop_storage : taco_shop_storage) : (list(operation) * taco_shop_storage) is +function buy_taco (const taco_kind_index: nat ; var taco_shop_storage : taco_shop_storage) : + (list(operation) * taco_shop_storage) is begin // Retrieve the taco_kind from the contract's storage const taco_kind : taco_supply = get_force(taco_kind_index, taco_shop_storage); @@ -46,7 +47,7 @@ function buy_taco (const taco_kind_index: nat ; var taco_shop_storage : taco_sho ### Purchase price formula Pedro's Taco Shop contract currently enables customers to buy tacos, at a computed price based on a simple formula. -``` +```pascaligo const current_purchase_price : tez = taco_kind.max_price / taco_kind.current_stock; ``` @@ -66,7 +67,7 @@ This means that after all the *purchase conditions* of our contract are met - e. ### Defining the recipient In order to send tokens, we will need a receiver address - which in our case will be Pedro's personal account. Additionally we'll wrap the given address as a *`contract(unit)`* - which represents either a contract with no parameters, or an implicit account. -``` +```pascaligo const ownerAddress : address = "tz1TGu6TN5GSez2ndXXeDX6LgUDvLzPLqgYV"; const receiver : contract(unit) = get_contract(ownerAddress); ``` @@ -77,7 +78,7 @@ const receiver : contract(unit) = get_contract(ownerAddress); Now we can transfer the `amount` received by `buy_taco` to Pedro's `ownerAddress`. We will do so by forging a `transaction(unit, amount, receiver)` within a list of operations returned at the end of our contract. -``` +```pascaligo const payoutOperation : operation = transaction(unit, amount, receiver) ; const operations : list(operation) = list payoutOperation @@ -89,7 +90,7 @@ end; ## Finalizing the contract ### **`taco-shop.ligo`** -``` +```pascaligo type taco_supply is record current_stock : nat; max_price : tez; @@ -129,7 +130,7 @@ function buy_taco (const taco_kind_index: nat ; var taco_shop_storage : taco_sho To confirm that our contract is valid, we can dry run it. As a result we see a *new operation* in the list of returned operations to be executed subsequently. -``` +```pascaligo ligo dry-run taco-shop.ligo --syntax pascaligo --amount 1 buy_taco 1n "map 1n -> record current_stock = 50n; @@ -157,12 +158,12 @@ end" Because Pedro is a member of the (STA) Specialty Taco Association, he has decided to donate **10%** of the earnings to the STA. We'll just add a `donationAddress` to the contract, and compute a 10% donation sum from each taco purchase. -``` +```pascaligo const ownerAddress: address = "tz1TGu6TN5GSez2ndXXeDX6LgUDvLzPLqgYV"; const donationAddress: address = "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx"; ``` -``` +```pascaligo const receiver : contract(unit) = get_contract(ownerAddress); const donationReceiver : contract(unit) = get_contract(donationAddress); 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 079dbb239..8dadb49cd 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 @@ -35,7 +35,7 @@ Each taco kind, has its own `max_price` that it sells for, and a finite supply f Current purchase price is calculated with the following equation: -``` +```pascaligo current_purchase_price = max_price / available_stock ``` @@ -71,8 +71,8 @@ The best way to install the dockerized LIGO is as a **global executable** throug To begin implementing our smart contract, we need an entry point. We'll call it `main` and it'll specify our contract's storage (`int`) and input parameter (`int`). Of course this is not the final storage/parameter of our contract, but it's something to get us started and test our LIGO installation as well. ### `taco-shop.ligo` -```Pascal -function main (const parameter : int; const contractStorage : int) : (list(operation) * int) is +```pascaligo +function main (const parameter: int; const contractStorage: int) : (list(operation) * int) is block {skip} with ((nil : list(operation)), contractStorage + parameter) ``` @@ -129,7 +129,7 @@ ligo dry-run taco-shop.ligo --syntax pascaligo main 4 3 We know that Pedro's Taco Shop serves two kinds of tacos, so we'll need to manage stock individually, per kind. Let's define a type, that will keep the `stock` & `max_price` per kind - in a record with two fields. Additionally, we'll want to combine our `taco_supply` type into a map, consisting of the entire offer of Pedro's shop. **Taco shop's storage** -```Pascal +```pascaligo type taco_supply is record current_stock : nat; max_price : tez; @@ -141,7 +141,7 @@ type taco_shop_storage is map(nat, taco_supply); Next step is to update the `main` entry point to include `taco_shop_storage` as its storage - while doing that let's set the `parameter` to `unit` as well to clear things up. **`taco-shop.ligo`** -```Pascal +```pascaligo type taco_supply is record current_stock : nat; max_price : tez; @@ -208,7 +208,7 @@ Let's start by customizing our contract a bit, we will: - change `taco_shop_storage` to a `var` instead of a `const`, because we'll want to modify it **`taco-shop.ligo`** -```Pascal +```pascaligo type taco_supply is record current_stock : nat; max_price : tez; @@ -231,7 +231,7 @@ In order to decrease the stock in our contract's storage for a specific taco kin **`taco-shop.ligo`** -```Pascal +```pascaligo type taco_supply is record current_stock : nat; max_price : tez; @@ -266,7 +266,7 @@ To make sure we get paid, we will: - if yes, stock for the given `taco_kind` will be decreased and the payment accepted **`taco-shop.ligo`** -```Pascal +```pascaligo type taco_supply is record current_stock : nat; max_price : tez; @@ -327,11 +327,11 @@ end" If you'd like to accept tips in your contract as well, simply change the following line, depending on which behavior do you prefer. **Without tips** -```Pascal +```pascaligo if amount =/= current_purchase_price then ``` **With tips** -```Pascal +```pascaligo if amount >= current_purchase_price then ``` diff --git a/gitlab-pages/website/core/Footer.js b/gitlab-pages/website/core/Footer.js index 4a1fa9bc5..8153941f8 100644 --- a/gitlab-pages/website/core/Footer.js +++ b/gitlab-pages/website/core/Footer.js @@ -24,57 +24,53 @@ class Footer extends React.Component { render() { return ( ); } diff --git a/gitlab-pages/website/pages/en/index.js b/gitlab-pages/website/pages/en/index.js index 8c9cac7de..bd86da348 100644 --- a/gitlab-pages/website/pages/en/index.js +++ b/gitlab-pages/website/pages/en/index.js @@ -9,86 +9,130 @@ const React = require("react"); const CompLibrary = require("../../core/CompLibrary.js"); +const hljs = require("highlight.js"); + const MarkdownBlock = CompLibrary.MarkdownBlock; /* Used to read markdown */ const Container = CompLibrary.Container; const GridBlock = CompLibrary.GridBlock; +const pre = "```"; + +const pascaligoExampleSmall = `${pre}pascaligo +// variant defining pseudo multi-entrypoint +// actions +type action is +| Increment of int +| Decrement of int + +function add + (const a: int; const b: int): int is + block { skip } with a + b + +function subtract + (const a: int; const b: int): int + is block { skip } with a - b + +// real entrypoint that re-routes the flow +// based on the action provided +function main + (const p: action; const s: int): + (list(operation) * int) is + block { skip } + with ((nil : list(operation)), + case p of + | Increment(n) -> add(s, n) + | Decrement(n) -> subtract(s, n) + end) +${pre}`; + +const pascaligoExample = `${pre}pascaligo +// variant defining pseudo multi-entrypoint actions +type action is +| Increment of int +| Decrement of int + +function add (const a : int ; const b : int) : int is + block { skip } with a + b + +function subtract (const a : int ; const b : int) : int is + block { skip } with a - b + +// real entrypoint that re-routes the flow based +// on the action provided +function main (const p : action ; const s : int) : + (list(operation) * int) is + block { skip } with ((nil : list(operation)), + case p of + | Increment(n) -> add(s, n) + | Decrement(n) -> subtract(s, n) + end) +${pre}`; +const cameligoExampleSmall = `${pre}ocaml +type storage = int + +(* variant defining pseudo multi-entrypoint + actions *) +type action = + | Increment of int + | Decrement of int + +let add (a: int) (b: int): int = a + b + +let subtract (a: int) (b: int): int = a - b + +(* real entrypoint that re-routes the flow + based on the action provided *) +let%entry main(p : action) storage = + let storage = + match p with + | Increment n -> add storage n + | Decrement n -> subtract storage n + in (([] : operation list), storage) +${pre}`; + +const cameligoExample = `${pre}ocaml +type storage = int + +(* variant defining pseudo multi-entrypoint actions *) +type action = + | Increment of int + | Decrement of int + +let add (a: int) (b: int): int = a + b + +let subtract (a: int) (b: int): int = a - b + +(* real entrypoint that re-routes the flow based on + the action provided *) +let%entry main(p : action) storage = + let storage = + match p with + | Increment n -> add storage n + | Decrement n -> subtract storage n + in (([] : operation list), storage) +${pre}`; + const PascalLIGOTab = () => (
-
- -
-          
-            // variant defining pseudo multi-entrypoint actions
-            
- type action is -
| Increment of int -
| Decrement of int -
-
- function add (const a : int ; const b : int) : int is -
block {"{ skip }"} with a + b
-
- function subtract (const a : int ; const b : int) : int is -
block {"{ skip }"} with a - b
-
- // real entrypoint that re-routes the flow based on the action - provided -
- function main (const p : action ; const s : int) : (list(operation) - * int) is -
block {"{ skip }"} with ((nil : list(operation)), -
case p of -
| Increment(n) -> add(s, n) -
| Decrement(n) -> subtract(s, n) -
end) -
-
-
-
-
+ {pascaligoExampleSmall} + {pascaligoExample}
); const CamelLIGOTab = () => (
-
-
-        
-          type storage = int 
-
- (* variant defining pseudo multi-entrypoint actions *)
-
- type action =
| Increment of int -
| Decrement of int -
-
- let add (a: int) (b: int) : int = a + b
-
- let subtract (a: int) (b: int) : int = a - b
-
- (* real entrypoint that re-routes the flow based on the action - provided *) -
-
- let%entry main (p : action) storage =
let storage =
match - p with -
| Increment n -> add storage n
| Decrement n -> subtract - storage n
in (([] : operation list), storage) -
-
-
-
+ {cameligoExampleSmall} + {cameligoExample}
); @@ -134,20 +178,32 @@ class HomeSplash extends React.Component { - + ); return (
+
+ {siteConfig.title} +

{siteConfig.tagline}

{siteConfig.taglineSub}

+ Try Online + +

+ Get Started + +
@@ -317,10 +373,8 @@ class Index extends React.Component {
{PartnerShowcase}
-

Our Partners

-

- We are not alone in this world -- here're some guys who support us -

+

Partners

+
); diff --git a/gitlab-pages/website/siteConfig.js b/gitlab-pages/website/siteConfig.js index ab081f669..80da6af85 100644 --- a/gitlab-pages/website/siteConfig.js +++ b/gitlab-pages/website/siteConfig.js @@ -82,8 +82,8 @@ const team = [ const siteConfig = { title: "LIGO", // Title for your website. tagline: - "LIGO is a statically typed high-level smart-contract language that compiles down to Michelson.", - taglineSub: "It seeks to be easy to use, extensible and safe.", + "LIGO is a friendly smart-contract language for Tezos", + taglineSub: "Michelson was never so easy", url: "https://your-docusaurus-test-site.com", // Your website URL baseUrl: "/", // Base URL for your project */ // For github.io type URLs, you would set the url and baseUrl like: @@ -116,7 +116,6 @@ const siteConfig = { team, /* path to images for header/footer */ - headerIcon: "img/logo.svg", footerIcon: "img/logo.svg", favicon: "img/logo.svg", @@ -141,11 +140,38 @@ const siteConfig = { */ // This copyright info is used in /core/Footer.js and blog RSS/Atom feeds. - copyright: `Copyright © ${new Date().getFullYear()} Marigold`, + copyright: `© ${new Date().getFullYear()} LIGO. All rights reserved.`, highlight: { // Highlight.js theme to use for syntax highlighting in code blocks. - theme: "default" + theme: "default", + hljs: function (hljs) { + hljs.registerLanguage('pascaligo', function (hljs) { + return { + // case_insensitive: true, + beginKeywords: '', + keywords: { + keyword: 'and begin block case const contains down else end fail for ' + + 'from function if in is list map mod nil not of or patch ' + + 'procedure record remove set skip step then to type var while with', + literal: 'true false unit int string some none bool nat list' + }, + lexemes: '[a-zA-Z][a-zA-Z0-9_]*', + contains: [ + hljs.C_LINE_COMMENT_MODE, + + { + className: 'type', + begin: /[A-Z][a-z]+/ + }, + { + begin: /[*+-:;\(\)\{\}|\>\<]/, + // className: 'ignore' + } + ] + } + }); + } }, // Add custom scripts here that would be placed in