Skip to content

Commit

Permalink
Merge pull request Zilliqa#163 from jubnzv/162_ci
Browse files Browse the repository at this point in the history
Fix grammar errors and add CI
  • Loading branch information
Anton Trunov authored Aug 29, 2022
2 parents 69ba8ff + 29d7166 commit 169be23
Show file tree
Hide file tree
Showing 8 changed files with 88 additions and 32 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: build

on:
- pull_request
- push

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install OS packages
run: sudo apt-get update && sudo apt-get install -yq python3 python3-pip libenchant-2-dev aspell-en
- name: Install Python packages
run: pip install -r requirements.txt
- name: Run spellcheck
run: pushd docs && make spell && popd
- name: Build HTML
run: pushd docs && make html && popd
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
# Scilla Docs

![](https://github.com/Zilliqa/scilla-docs/workflows/build/badge.svg)

Scilla short for Smart Contract Intermediate-Level LAnguage is a smart contract
language being developed for Zilliqa.

## Contributing

If you spot any issues or have any ideas on how we can improve the
documentation, help us log an issue
[here](https://github.com/Zilliqa/scilla-docs/issues)
[here](https://github.com/Zilliqa/scilla-docs/issues).

## Installing dependencies

To compile the documentation you need the following dependencies.

1. You need to have [sphinx](http://www.sphinx-doc.org/en/master/) and [sphinx_rtd_theme](https://github.com/readthedocs/sphinx_rtd_theme) installed.
Install them by running `pip install -U Sphinx sphinx_rtd_theme`.
2. Our build system checks for spelling mistakes automatically (we use the UK
spelling, by the way). To enable it some additional dependencies are needed.
- The [sphinxcontrib.spelling][spelling] spelling cheker for Sphinx:
`pip install -U sphinxcontrib-spelling`.
- The command above will automatically install [PyEnchant][pyenchant] library
which itself needs the C [Enchant][enchant] library which one has to
install using e.g. your OS's package manager. You can find the installation
instructions [here][enchant-install]. Basically, you want either
`libenchant` or `enchant` package depending on your setup.

[spelling]: https://sphinxcontrib-spelling.readthedocs.io/en/latest/index.html
[pyenchant]: https://pyenchant.github.io/pyenchant/index.html
[enchant]: https://www.abisource.com/projects/enchant/
[enchant-install]: https://pyenchant.github.io/pyenchant/install.html#installing-the-enchant-c-library

To compile the documentation you need the following system packages:
[Python3](https://www.python.org/downloads/) with the
[pip](https://pypi.org/project/pip/) package and
[libenchant](https://www.abisource.com/projects/enchant/) used to check
spelling.

On Debian-based systems you can install them with:
```
sudo apt-get install python3 python3-pip libenchant-2-dev
```

Then clone this repository and install the required Python packages from
[`requirements.txt`](https://github.com/Zilliqa/scilla-docs/blob/master/requirements.txt):
```
pip3 -U install -r requirements.txt
```

## Building the docs

### Spellchecking

Run `make spell` from [docs](./docs/) folder. In case of any found spelling
mistakes you will see an output like the following.
mistakes you will see an output like the following:
```
Spelling checker messages written to /path/to/scilla-docs/docs/build/spelling/output.txt
WARNING: Found 1 misspelled words
Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXOPTS = -W
SPHINXBUILD = sphinx-build
SPHINXPROJ = scilla-doc
SOURCEDIR = source
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = 'en'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down
4 changes: 2 additions & 2 deletions docs/source/scilla-by-example.rst
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ given as an immutable parameter:
The type of the ``admin`` field is ``ByStr20 with end``, which is an
`address type`. As in the earlier examples ``ByStr20`` is the type of
byte strings of length 20, but we now add the addtional requirement
byte strings of length 20, but we now add the additional requirement
that when that byte string is interpreted as an address on the
network, the address must be `in use`, and the contents at that
address must satisfy whatever is between the ``with`` and ``end``
Expand Down Expand Up @@ -1036,7 +1036,7 @@ tokens to its own account for holding until the order is matched.
Similarly, before a user matches an order, the user should provide the
exchange with an allowance of the token that the order placer wants to
buy. The user can then match the order, and the exchange can check
that the allowance is sufficent. The exchange then transfers those
that the allowance is sufficient. The exchange then transfers those
tokens to the user who placed the order, and transfers to the matching
user the tokens that it transferred to itself when the order was
placed.
Expand Down
10 changes: 5 additions & 5 deletions docs/source/scilla-in-depth.rst
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ mathematical. Scilla contains the following types of statements:
- ``x <- & c.f`` : Remote fetch. Fetch the value of the contract field
``f`` at address ``c``, and store it into the local variable
``x``. Note that the type of ``c`` must be an address type
containing the field ``f``. See the secion on :ref:`Addresses
containing the field ``f``. See the section on :ref:`Addresses
<Addresses>` for details on address types.

- ``x <- & c as t``: Address type cast. Check whether ``c`` satisfies
Expand Down Expand Up @@ -824,7 +824,7 @@ converting between byte string types:
- ``builtin to_bystr h`` : Convert a value ``h`` of type ``ByStrX`` (for
some known ``X``) to one of arbitrary length of type ``ByStr``.

- ``builtin to_bystrX h`` : (note that ``X`` is a numerical paratemeter here and
- ``builtin to_bystrX h`` : (note that ``X`` is a numerical parameter here and
not a part of the builtin name, see the examples below)

- if the argument ``h`` is of type ``ByStr``: Convert an arbitrary size byte
Expand Down Expand Up @@ -920,7 +920,7 @@ The hierarchy of address types defines a subtype relation:
- Any contract address type ``ByStr20 with contract ... end`` is
a subtype of ``ByStr20 with end``.

- Any contract address type specifying explict fields ``ByStr20 with
- Any contract address type specifying explicit fields ``ByStr20 with
contract field f1 : t11, field f2 : t12, ... end`` is a subtype of
a contract address type specifying a subset of those fields
``ByStr20 with contract field f1 : t21, field f2 : t22, ... end``,
Expand Down Expand Up @@ -1933,7 +1933,7 @@ As an example, consider the following two contracts:
end
Even though both contracts define identical types ``T``, the two types
are considered different in Scilla. In particlar this means that the
are considered different in Scilla. In particular this means that the
message sent from ``Contract1`` to ``Contract2`` will not trigger the
``Receiving`` transition, because the value sent as the ``param``
message field has the type ``T`` from ``Contract1``, whereas the type
Expand Down Expand Up @@ -2602,7 +2602,7 @@ Any run-time failure during the execution of a transaction causes the
entire transaction to be aborted, with no further statements being
executed, no further messages being processed, all state changes being
rolled back, and all transferred funds returned to their respective
senders. However, gas is still charged for the transcaction up until
senders. However, gas is still charged for the transaction up until
the point of the failure.

The total number of messages that can be sent in a single transaction
Expand Down
33 changes: 32 additions & 1 deletion docs/source/spelling_wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ SHA
Schnorr
Shogi
bech
blockhain
blocknumber
cashflow
cryptographic
Expand Down Expand Up @@ -57,3 +56,35 @@ typechecks
unassociated
uninstantiated
untyped
Zilliqa
Scilla
substring
substrings
Uint
Polynetwork
deserializing
keypairs
mainnet
testnet
keystore
stablecoins
endianness
runtime
unpausing
blockchain
onwards
pseudocode
subtype
typecheck
subtyping
explicit
OCaml
matcher
unlisting
reentrancy
automata
stateful
Qa
blockchains
expressivity
sharding
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sphinx-rtd-theme
sphinxcontrib-spelling
Sphinx>=5.0,<6.0

0 comments on commit 169be23

Please sign in to comment.