book
-src
book.toml
custom.css
.d/
--- /dev/null
+# Example Vale config file (`.vale.ini` or `_vale.ini`)
+
+# Core settings
+StylesPath = ci/vale/styles
+
+# The minimum alert level to display (suggestion, warning, or error).
+#
+# CI builds will only fail on error-level alerts.
+MinAlertLevel = warning
+
+# The "formats" section allows you to associate an "unknown" format
+# with one of Vale's supported formats.
+[formats]
+mdr = md
+
+# Global settings (applied to every syntax)
+[*]
+# List of styles to load
+BasedOnStyles = write-good, Joblint
+# Style.Rule = {YES, NO} to enable or disable a specific rule
+vale.Editorializing = YES
+# You can also change the level associated with a rule
+vale.Hedging = error
+
+# Syntax-specific settings
+# These overwrite any conflicting global settings
+[*.{md,txt,mdr}]
+vale.Editorializing = YES
+
+BlockIgnores = (?s) *(@\x60\x60\x60.*?@\x60\x60\x60)
ensure:
@sh scripts/ensure.sh
+lint:
+ vale docs
+
clean:
@[ -d src ] && mdbook clean || true
# Benchmarks
-@exec for a in benchmark_results/*.png; do echo "![${a:-4}]($a \"${a:-4}\")"; done
+@exec for a in $(find benchmark/results -type f -name "*.png"); do echo "![$(basename $a)]($(sed 's/benchmark\/results/assets/' <<< $a) \"${a:-4}\")"; done
Thanks to the build system, you're gonna get on tracks fast.
+<details>
+<summary>
+Make your live easier
+</summary>
+use <code>export TRANSLATION_TARGET=xxx</code>
+so you don't have to repeat it on the command line
+</details>
-> You might want to export TRANSLATION_TARGET,
-so you don't have to set it on the command line for commands requiring it
-`export TRANSLATION_TARGET="xxx"`
-
-## 1) Init the translation language
+## Step 1: *Init the translation language*
You have to make sure there is a directory for your target language (e.g.: fr, en, es_ES ...).
Where `<xxx>` is your language of choice.
It will fail if your language already exists, but this is not a problem.
-## 2) Edit
+## Step 2: *Edit*
Next, you should adjust the translations.
What about using your favorite editor?
make translation-edit TRANSLATION_TARGET=<xxx>
```
-## 3) Update
+## Step 3: *Update*
-Maybe the sources changed, and there is more message to translate?
+Maybe the sources changed, and there is more messages to translate?
``` sh
make translation-update
```
-This will update all languages.
-You can now get back to [step 2](#2-Edit).
+This will update all languages.
+You can now get back to [step 2](#step-2-Edit).
-## Add to VCS
+## Step 4: *Add to [VCS](https://en.wikipedia.org/wiki/Version_control)*
It's now time to add your changes to the package
make translation-commit TRANSLATION_TARGET=<xxx>
```
-Now please submit a pull request.
+> In [Gwion](:gwion:/Gwion)'s case,
+the `vcs` is the well known [git](https://git-scm.com/),
+but the `make` recipe makes things simple
+
+Now please submit a [pull request](:gwion:/Gwion/pulls).
git submodule update --init util ast
```
-> At this point, you might want to configure the build.
+> At this point, you may want to configure the build.
In this case, have a look at the [configuration page](Configure.md)
``` sh
make install
```
+
> You may need root privilege to do this.
[ "$n" -eq 0 ] && n=1
source tests/sh/common.sh
```
-
-## TODO
- [ ] `bailout` system for early exit on failure
@exec make -s decl0.test
## Declaring a reference
-However ...
+
@``` decl1.gw
Object @ref;
<<< "Reference points to no object yet: ", ref >>>;
# Welcome to Gwion
-gwion is a easy yet powerful, strongly-timed programming language,
+:gwion: is a strongly timed programming language,
+aiming to be easy, powerful and [fast](Benchmarks.html) strongly-timed programming language,
## And now for the hello world
-So, as it is mandatory, here is the piece of code you're waiting
-for:
+Here is the piece of code you're waiting for :tada::
@``` helloworld.gw
<<< "Hello, World!" >>>;
let start simple ;-)
The easiest way to do an action repeatidly in Gwion is, ... the **repeat** keyword!
-## Very basic example
+## Basic example
+
@``` repeat.gw
repeat(3)
<<< "Hello, world!" >>>;
@```
@exec make -s CONTAINS="Hello" repeat.test
+
## Block example
+
of course this also works with a block code.
@``` repeat2.gw
@```
@exec make -s forloop0.test
-Of course, it also works with a block of code.
+It also works with a block of code.
@``` forloop2.gw
for(int i; i < 3; ++i) {
@exec make -s forloop4.test
### Auto Pointer loop
-With the simple auto loop, you only get the value in the array.
-If you want to change it, you need a pointer
+If you want to change it the value in the array, you need a pointer
@``` forloop5.gw
int array[2][3];
## Overview
-Simply put, *lambda*s are anonymous functions.
+*lambda*s are anonymous functions.
The syntax to create them is simple:
```
[here](https://en.wikipedia.org/wiki/Enumerated_type)
## Enums in gwion
-You simply use an enum like this
-``` enum0.gw
+
+You use an enum like this
+
+@``` enum0.gw
enum Optionnal_name {
zero, one, two
};
<<< zero, one, two >>>;
-```
+@```
+@exec make -s enum0.test
+
+## Storage and access Specifiers
When inside a class,
-Enums are automatically declared **static**,
+Enums are automatically declared **static**, and can't be **global**
but they accept **private** or **protect** specifiers.
-
-When not in a class, they can be made `global`
+++ /dev/null
-# tool to build the doc
-DOCTOOL = mkdocs -q
-DOCBUILD = build
-DOCSERVE = serve
-
-# output box css
-BACKGROUND = background-color:\#f2f2f2;
-BORDER = border: 5px solid \#546e7a;
-PADDING = padding: 10px;
-MARGIN = margin-right: 20%; margin-left: 20%;
-BORDER_RADIUS = -moz-border-radius: 15px; -webkit-border-radius: 15px;
-CSS = "$(BACKGROUND) $(BORDER) $(PADDING) $(MARGIN) $(BORDER_RADIUS)"
-
-# output box status
-NOTERM_OK= &\#10004;
-NOTERM_NOT_OK= &\#10008;
-
-# terminal status
-INTERM_OK = \033[32mOK\033[0m
-INTERM_NOT_OK = \033[31mNOT OK\033[0m
-
-# valgrind
-VALGRIND ?= valgrind
-VALGRIND_LOG ?= vlog
-VALGRIND_OPT += --leak-check=yes --log-file=${VALGRIND_LOG}
-
-## ensure no valgrind if requested
-ifeq ($(VALGRIND), NO_VALGRIND)
-VALGRIND =
-VALGRIND_OPT =
-endif
-
}
mk_target() {
- sed 's/```\(.*\)gw/```\1cpp/' $1
+ sed 's/```\(.*\)gw/```\1cpp/' $1 |
+ sed 's/:tada:/\😜/g' |
+ sed 's/:champagne:/\🍾/g' |
+ sed 's#:gwion:#[Gwion](https://github.com/fennecdjay/Gwion)#g'
footer
}
}
doc2src() {
+echo $1
mdr $1 || return
mdfile=${1::-1}
target=$(sed 's/docs/src/' <<< $mdfile)
if [ $1 ]
#then [[ $1 == *".mdr" ]] && doc2src $1
then [ -f $1 ] && doc2src $1
-echo $1
else runall
fi