Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Ako tries to fill the gap by providing at the same time:
npm install -g ako-lang

# Execute
ako ./test.ako
ako run ./test.ako
```

## Standalone Executable
Expand All @@ -68,7 +68,7 @@ You can directly use standalone executable of the interpreter : [Release page](h

It's compiled for **Windows**, **Mac** and **Linux** and once downloaded, you can use it to run Ako scripts
```sh
./ako.exe test.ako
./ako.exe run test.ako
```

## CDN
Expand All @@ -93,7 +93,7 @@ npm install # install deps
npm run build
npm link # link the local file globally

ako ./samples/ # use the interpreter
ako run ./samples/ # use the interpreter
```

## Other
Expand Down
2 changes: 2 additions & 0 deletions _sidebar.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
* [Ako](/)
* [Getting Started](./docs/getting_started.md)
* [CLI](./docs/cli_index.md)
* [Module](./docs/module_index.md)
* [Grammar](./docs/grammar_index.md)
* [Basic Types](./docs/grammar/grammar_basic.md)
* [Conditional](./docs/grammar/grammar_cond.md)
Expand Down
6 changes: 3 additions & 3 deletions ako_grammar.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Ako {
Metadata = "##" id Term

TaskDef = "task" id (Array)? Block
SkipTask = "@@" (id ".")? id "(" NamedArguments ")"
Task = "@" (id ".")? id "(" NamedArguments ")"
SkipTask = "@@" ListOf<id, "."> "(" NamedArguments ")"
Task = "@" ListOf<id, "."> "(" NamedArguments ")"
NamedArguments = ListOf<(KeyValue | Expr), ",">
Arguments = ListOf<Expr, ",">

Expand All @@ -26,7 +26,7 @@ Ako {
ExprItem = LambdaInline | MathExpr

Term = Fn | bool | Var | Number | String | Array | Dictionary | Last
Fn = (id ".")? id "(" Arguments ")"
Fn = ListOf<id, "."> "(" Arguments ")"
// Lambda = "(" ListOf<id, ","> ")" "=>" Block
LambdaInline = "(" ListOf<id, ","> ")" "=>" Expr

Expand Down
52 changes: 52 additions & 0 deletions docs/cli_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# AKO CLI

## Create a new module

This will create a new module folder structure with this name

```
ako new [name of your module]
```

## Run some code

Execute a script or a module

```bash
ako run ./file.ako

# or a manifest
ako run ./manifest.yaml

# or in a project
ako run
```

# Manage dependencies

## Install dependencies
Install dependencies declared in the manifest file
```bash
ako deps install
```

## Add dependency
Add a dependency to the manifest, download and unzip the necessary files
```bash
ako deps add [path]
```
### Supported path:
* Filepath: ```ako deps add ./path/on/your/system```
* Github: ```ako deps add github_organization/repo```
* with branch: ```ako deps add github_organization/repo#develop```
* or tags: ```ako deps add github_organization/repo#v1.0.0```
* Gitlab: ```ako deps add gitlab:organization/repo```

### Options:
* -p, --path : If needed, can use a subfolder of a repository
* -s, --scope : Name used to expose this module in your ako code

## Remove dependency
```bash
ako deps remove [path]
```
4 changes: 2 additions & 2 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
npm install -g ako-lang

# Execute
ako ./test.ako
ako run ./test.ako
```

## Standalone Executable
Expand All @@ -16,7 +16,7 @@ You can directly use standalone executable of the interpreter : [Release page](h

It's compiled for **Windows**, **Mac** and **Linux** and once downloaded, you can use it to run Ako scripts
```sh
./ako.exe test.ako
./ako.exe run test.ako
```

## CDN
Expand Down
40 changes: 40 additions & 0 deletions docs/module_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Module

## Description
Ako encourage reusability by organizing code in standalone modules.

Each module contains:
* Ako scripts
* Assets
* Native function/tasks

All the configuration is all provided by the `manifest.yaml` at the root

## Structure
the recommended file structure is
* `manifest.yaml` : Module manifest
* `./src/` : Ako code folder
* `./assets/` : Assets that can be required by Ako code
* `./lib/` : Native function or task implementation

it can be customized in manifest

Look the [CLI dependencies](./cli_index.md) if you want to want to create module with `ako new [name]`

## Dependencies
Any module can load 3rd party code by declaring dependencies. Those dependencies can be loaded localy on your file system, or downloaded from git services like github/gitlab.

Look the [CLI dependencies](./cli_index.md) if you want to add a dependency to your project.

### Example:
```yaml
id: Test
entry:
- main.ako
deps:
- url: ./path/module
scope: MODULE
```
This module under `./path/module` will be loaded in a dedicated scope `MODULE.`and you can call any of his task or function. `@MODULE.main()`

By default, the scope is the `id` of this dependency, but it can be renamed to avoid conflict
Loading