--- /dev/null
+book
+book.toml
--- /dev/null
+serve: ensure
+ @sh scripts/run.sh
+
+build: ensure
+ @mdbook build
+
+book: build
+
+deploy: book
+ @git subtree push --prefix book origin gh-pages
+
+ensure:
+ @sh scripts/ensure.sh
+
+clean:
+ @[ -d src ] && mdbook clean
+
+clean-tests:
+ @rm -rf *.gw log vlog
+
+clean-all: clean clean-tests
+ @rm -rf src
+
+.SUFFIXES: .gw .test
+.gw.test:
+ @sh scripts/test.sh $< "${CONTAINS}"
--- /dev/null
+# Benchmarks
+
+We'll need a bash script
+
+<link rel=styleSheet href="../assets/doc.css" TYPE="text/css"><div id="org-categories"><ul class="lev1"><li><a href="#">Show the code</a></li><ul class="lev2"><a href="#">
+@``` benchmark.sh
+#!/bin/sh
+language=("gwion" "wren" "lua")
+extension=("gw" "wren" "lua")
+test_dir="tests/benchmark"
+plot_script="bench.plot"
+: "${repeats:=10}"
+
+run() {
+ perf stat -r"$repeats" "$1" "$test_dir/$3.$2" 2>&1 | grep "time elapsed" |
+ sed 's/ *\([0-9]*\),\([0-9]*\) .* seconds time elapsed *( +- *\([0-9]*\),\([0-9]*\)% )/\1.\2 \3.\4/'
+}
+
+get_list() {
+ for file in $test_dir/*.gw
+ do basename "$file" .gw
+ done
+}
+
+get_test() {
+ for (( i=0; i<=$(( ${#language[@]} -1 )); i++ ))
+ do
+ if [ -f "$test_dir/$1.${extension[$i]}" ]
+ then echo "${language[$i]} $(run "${language[$i]}" "${extension[$i]}" "$1")"
+ fi
+ done > "docs/assets/benchmark/$1.dat"
+}
+
+plot() {
+ gnuplot -e "bench='$1'" "$plot_script"
+}
+
+for bench in $(get_list)
+do
+echo $bench
+ get_test "$bench"
+ plot "$bench"
+ echo "### $bench"
+ echo '<link rel=styleSheet href="../assets/doc.css" TYPE="text/css"><div id="org-categories"><ul class="lev1"><li><a href="#">Show the code</a></li><ul class="lev2"><a href="#">'
+ echo "\`\`\`"
+ cat "$test_dir/$bench.gw"
+ echo "\`\`\`"
+ echo '</a></a></li></ul></ul></div>'
+ echo "![](assets/benchmark/$bench.png)"
+done
+@```
+</a></a></li></ul></ul></div>
+
+### and a gnuplot script
+
+<link rel=styleSheet href="../assets/doc.css" TYPE="text/css"><div id="org-categories"><ul class="lev1"><li><a href="#">Show the code</a></li><ul class="lev2"><a href="#">
+@``` bench.plot
+set terminal png truecolor
+
+#if (!exists("bench"))
+# bench = 'bench'
+if (!exists("test_dir"))
+ test_dir = 'tests/benchmark'
+
+dat_name = sprintf("docs/assets/benchmark/%s.dat", bench)
+
+stats dat_name using 0:2 noout
+max = STATS_max_y+(0.1*STATS_max_y)
+
+set title bench
+set output sprintf("docs/assets/benchmark/%s.png", bench)
+set xrange [-0.5:((ceil(STATS_max_x))+0.5)]
+set yrange [0:max]
+set boxwidth 0.50
+set nokey
+set xtics nomirror
+set ytics nomirror
+
+set style fill transparent solid 0.25 # partial transparency
+set style fill noborder # no separate top/bottom lines
+
+plot dat_name using 0:2:($2*($3/100.0)):xtic(2) with boxerrorbar lc "blue" notitle, \
+ '' using 0:(max-(0.05*max)):1 with labels
+@```
+</a></a></li></ul></ul></div>
+
+## Show the results
+Then just run it
+@exec bash benchmark.sh; rm bench.plot benchmark.sh
--- /dev/null
+# How this doc is build
+
+## mdr
+
+## makefile
+
+## mkdocs
--- /dev/null
+# Contributing translations
+
+First off, thank you for considering translating gwion.
+
+Thanks to the build system, you're gonna get on tracks fast.
+
+
+> 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
+
+You have to make sure there is a directory for your target language (e.g.: fr, en, es_ES ...).
+
+``` sh
+make translation-init TRANSLATION_TARGET=<xxx>
+```
+
+Where `<xxx>` is your language of choice.
+It will fail if your language already exists, but this is not a problem.
+
+## 2) Edit
+
+Next, you should adjust the translations.
+What about using your favorite editor?
+
+``` sh
+make translation-edit TRANSLATION_TARGET=<xxx>
+```
+
+## 3) Update
+
+Maybe the sources changed, and there is more message to translate?
+
+``` sh
+make translation-update
+```
+
+This will update all languages.
+You can now get back to [step 2](#2-Edit).
+
+## Add to VCS
+
+It's now time to add your changes to the package
+
+``` sh
+make translation-commit TRANSLATION_TARGET=<xxx>
+```
+
+Now please submit a pull request.
--- /dev/null
+# Contributing
--- /dev/null
+index.md
+ContributingTranslation.md
--- /dev/null
+# Build / Configure Gwion
+
+## Configure
+### gwion-util
+
+ * `USE_MEMCHECK`: compile with debug flags (`-g`) and enable asserts
+ * `USE_COVERAGE`: add coverage instrumentation
+
+
+## Make
+Basically, all that is left to do is
+```sh
+make
+```
+The only environment variable affecting the operation is `PREFIX`
+
+Except `--(no-)double`, everything can be set when running make,
+using environment variables.
+
+Drivers can be set on using, e.g. for *alsa* : `ALSA_D=1` or `ALSA_D=on`.
+In the same way, then can be disabled with `ALSA_D=0` or `ALSA_D=off`
+
+### Running tests
+```bash
+make tests
+```
+to run all tests, or
+```bash
+bash util/test.sh my_file_or_directory (.. other files/dirs ...)
+```
+to run specific ones.
+look [here](#testing.md) for more.
+## Install
+*maybe as root*
+```sh
+make install
+```
+The only environment variable affecting the operation is `PREFIX`
--- /dev/null
+# Configuring Gwion
+
+## util/config.mk
+
+double
+
+gettext
+
+memcheck
+
+lto
+
+coverage
+
+## ast/config.mk
+
+## config.mk
+Here are a few choices left
--- /dev/null
+# Installing gwion
+
+## Get the sources
+
+The source is accessible on [github](https:#!github.com).
+
+Provided you have git installed, you can get it with:
+
+``` sh
+git clone https:#!github.com/fennecdjay/gwion
+```
+
+then change to the source directory
+``` sh
+cd gwion
+```
+
+### Don't forget submodules
+
+You'll need the sources for all base module
+``` sh
+git submodule update --init util ast
+```
+
+> At this point, you might want to configure the build.
+ In this case, have a look at the [configuration page](Configure.md)
+
+
+## Build the libraries and program
+``` sh
+make
+```
+
+## Install the package
+
+``` sh
+make install
+```
+> You may need root privilege to do this.
--- /dev/null
+# First Steps
--- /dev/null
+index.md
+Configure.md
+InstallingGwion.md
--- /dev/null
+# Keywords
+
+ * fun/function
+ * operator
+ * return
+ * goto
+ * switch/case/default
+ * if/else
+ * break/continue
+ * until/do/while/for/repeat
+
+
+
+
+ * global/static
+ * private/protect
+ * const
+
+ * new
+ * spork
+ * fork
+ * typeof
+
+ * typedef
+ * class
+ * dtor
+ * extends
+ * enum
+ * union
+
+ * auto
--- /dev/null
+# Makefile
+
+## Basic operations
+
+## translations
+
+## Docs
--- /dev/null
+# Special Values
+
+ * me
+ * this
+ * vararg
+ * maybe
--- /dev/null
+# Tests
+[test.sh](https:#!github.com/fennecdjay/Gwion/blob/dev/util/test.sh)
+requires [valgrind](http:#!valgrind.org/)
+there are two kinds of tests:
+ * [gwion](#gwion-tests)
+ * [bash](#bash-tests)
+
+## Gwion tests
+those tests are just gwion (.gw) files, handling special comments:
+ * `#! [skip]` (*optionally* followed by reason to skip)
+ * `#! [todo]` (*optionally* followed by reason to delay testing)
+ * `#! [contains]` followed by string to match
+ * `#! [excludes]` followed by string not to match
+
+## Shell test
+those tests are just bash (.sh) files.
+they should start with this snippet
+```bash
+#!/bin/bash
+# [test] #5
+n=0
+[ "$1" ] && n="$1"
+[ "$n" -eq 0 ] && n=1
+source tests/sh/common.sh
+```
+
+## TODO
+ [ ] `bailout` system for early exit on failure
--- /dev/null
+# Declarations
+
+## Basics
+
+Declaring a primitive or an object is quite straight forward:
+@``` decl0.gw
+int i;
+Object o;
+<<< i, " ", o >>>;
+@```
+@exec make decl0.test
+
+## Declaring a reference
+However ...
+@``` decl1.gw
+Object @ref;
+<<< "Reference points to no object yet: ", ref >>>;
+#!Object o @=> ref;
+new Object @=> ref;
+<<< "But now it does: ", ref >>>;
+@```
+@exec make decl1.test
+
+## Arrays
+
+### array as refs
+
+@``` decl2.gw
+int ref[];
+<<< ref >>>;
+new int[2] @=> ref;
+<<< ref >>>;
+@```
+@exec make decl2.test
--- /dev/null
+# Global Values
+
+ * adc
+ * blackhole
+ * dac
+ * pi
+ * null
+ * samp
+ * ms
+ * second
+ * hour
+ * me
+ * this
+ * \__func__
+ * \__file__
+ * \__line__
--- /dev/null
+# Overview
--- /dev/null
+index.md
+BUILDING.md
+declaration.md
+First_Steps
+globalvalues.md
+Keywords.md
+Make.md
+SpecialWords.md
+Testing.md
--- /dev/null
+# Control Flow
+
+## Repeats
+let start simple ;-)
--- /dev/null
+# the Repeat keyword
+let start simple ;-)
+The easiest way to do an action repeatidly in Gwion is, ... the **repeat** keyword!
+
+## Very 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
+repeat(3) {
+ maybe ? "You" : "Me" => string s;
+ <<< "Hello, ", s, "!" >>>;
+}
+@```
+@exec make -s CONTAINS="Hello" repeat2.test
--- /dev/null
+# For Loops
+**For** loops in Gwion is pretty similar to classic **C** syntax
+
+## basic loops
+@``` forloop0.gw
+for(int i; i < 3; ++i)
+ <<< i >>>;
+@```
+@exec make -s forloop0.test
+
+Of course, it also works with a block of code.
+
+@``` forloop2.gw
+for(int i; i < 3; ++i) {
+ i/2 => float f1;
+ i/2. => float f2;
+ <<< i, " " , f1, " ", f2 >>>;
+}
+@```
+@exec make -s forloop2.test
+
+## Nested Loops
+@``` forloop3.gw
+int array[3][4];
+
+for(int i; i < 3; ++i) {
+ for(int j; j < 4; ++j) {
+ <<< array[i][j] >>>;
+ }
+}
+@```
+@exec make -s forloop3.test
+
+### Auto Loops
+
+#### Simple auto loop
+@``` forloop4.gw
+int array[2][3];
+for(auto a: array) {
+ <<< a >>>;
+ for(auto b: a)
+ <<< b >>>;
+}
+@```
+@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
+
+@``` forloop5.gw
+int array[2][3];
+int i;
+for(auto a: array) {
+ for(auto @b: a)
+ <<< ++i => *b >>>;
+}
+for(auto a: array) {
+ for(auto @b: a)
+ <<< *b >>>;
+}
+@```
+@exec make -s forloop5.test
--- /dev/null
+# Control Flow
--- /dev/null
+index.md
+ControlFlow.md
+forloop.md
+Loops.md
+Repeat.md
+whileuntil.md
--- /dev/null
+# Loops
+
+@``` while0.gw
+while(true) {
+ if(maybe)
+ break;
+ <<< "running..." >>>;
+}
+@```
+@exec make -s while0.test
+
+well this may output nothing...
+lets try
+
+@``` while1.gw
+<<< maybe >>>;
+do{
+ if(maybe)
+ break;
+ <<< "running..." >>>;
+} while(true);
+@```
+@exec make -s while1.test
--- /dev/null
+# Giving gwion a new driver
+
+## basics
+
+> in order to use GWION_CTL ...
+
+# concept
+
+# upd driver
--- /dev/null
+# Writing a Gwion plugin
+
+> THIS IS OUTDATED. please look at the source code in src/lib/ instead
+
+ * [getting started]
+
+## Getting started
+use the script
+
+### headers
+```
+#include "vm.h"
+#include "instr.h"
+#include "import.h
+```
+<!-- TODO: verify this -->
+
+### Class
+Define the type:
+```
+struct Type_ t_mytype = { "MyType", SZ_INT, &t_object};
+```
+> every type extending t_object should have SZ_INT
+
+### Handling Constructors and Destructors
+#### CTOR
+```
+CTOR(mytype_ctor) {
+ /* constructor code here */
+}
+```
+#### DTOR
+```
+DTOR(mytype_dtor) {
+ /* destructor code here */
+}
+```
+
+those macros provide two variables:
+ * `o`: the *M_Object* for the (con/des)tructor
+ * `shred`: the *VM_Shred* for the (con/des)tructor
+
+```
+CHECK_BB(import_class_begin(env, &t_mytpe, env->global_nspc, mytype_ctor, mytype_dtor))
+```
+#### variable
+declare a `m_int`. coding convention require
+ * a leading *_o*
+ * a following *_type_*
+```c
+m_int o_mytype_myvaroffset;
+```
+#### function
+```c
+/* declare a member function */
+MFUN(mytype_memberfunction) {
+ /* code here */
+}
+
+SFUN(mtype_staticfunction) {
+ /* code here */
+}
+```
+
+#### operator
+
+### Import function
+
--- /dev/null
+# Extending
--- /dev/null
+index.md
+WIP_Driver.md
+WIP_Plugins.md
--- /dev/null
+# Lambda
+
+## Overview
+
+Simply put, *lambda*s are anonymous functions.
+
+The syntax to create them is simple:
+```
+\ variable0 variable1 ... { your code here }
+```
+You can even use it to
+### Call a function just once
+@``` lambda_call0.gw
+\ i { <<< "passed '", i, "'" >>>; }(3);
+@```
+@exec make -s CONTAINS="passed '3'" lambda_call0.test
+
+
+## Use case
+
+### Passing to a function pointer
+@``` lambda_fptr0.gw
+typedef void fptr_t(int);
+\ i { <<< "passed '", i, "'" >>>; } @=> fptr_t fptr;
+fptr(4);
+@```
+@exec make -s CONTAINS="passed '4'" lambda_fptr0.test
+
+### As Argument to Functions
+@``` lambda_args0.gw
+typedef void fptr_t(int);
+fun void test(fptr_t fptr) {
+ fptr(5);
+}
+test(\ i { <<< "passed '", i, "'" >>>; });
+@```
+@exec make -s CONTAINS="passed '5'" lambda_args0.test
--- /dev/null
+# Variadic functions
+
+> A function whoses arity is not fixed.
+
+Well, a function that takes a fixed number of arguments, and additionnal ones.
+
+## a simple example
+@``` variadic.gw
+fun void variadic_test(int i, ...) {
+ <<< "first argument is ", i >>>;
+ vararg.start;
+ <<< "\tadditionnal argument", vararg.i >>>;
+ vararg.end;
+}
+variadic_test(1);
+variadic_test(1, 2);
+variadic_test(1, 2, 3);
+@```
+@exec make variadic.test
--- /dev/null
+# Functions
+
+## a simple (commented example)
+
+@``` function0.gw
+#! declare function 'test_function'
+#! with return type int
+#! taking an int as argument
+fun int test_function(int arg) {
+ #! return the argument + 2
+ return arg + 2;
+}
+
+#! now call the function (and debug print the result)
+<<< test_function(0) >>>;
+#! or use alternate syntax
+<<< 1 => test_function >>>;
+@```
+@exec make -s function0.test
--- /dev/null
+# Functions
--- /dev/null
+index.md
+function.md
+Lambdas.md
+Variadic.md
--- /dev/null
+# Gwion Preprocessor
--- /dev/null
+# Enums
+
+For those who don't know about enumerated types,
+you can read about those
+[here](https://www.geeksforgeeks.org/enumeration-enum-c) and
+[here](https://en.wikipedia.org/wiki/Enumerated_type)
+
+## Enums in gwion
+You simply use an enum like this
+``` enum0.gw
+enum Optionnal_name {
+ zero, one, two
+};
+<<< zero, one, two >>>;
+```
+
+When inside a class,
+Enums are automatically declared **static**,
+but they accept **private** or **protect** specifiers.
+
+When not in a class, they can be made `global`
--- /dev/null
+# Function Pointers
--- /dev/null
+# Primitive types
--- /dev/null
+# Typedefs
--- /dev/null
+# Union types
--- /dev/null
+index.md
+Enums.md
+Function_Pointers.md
+Primitives.md
+Typedefs.md
+Unions.md
--- /dev/null
+# Reference
--- /dev/null
+index.md
+ControlFlow
+Extending
+Functions
+Types
+Preprocessor.md
--- /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
+
--- /dev/null
+.mdr {
+
+
+}
+
+footer {
+ text-align: center;
+ font-size: small;
+ font-style: italic;
+}
--- /dev/null
+# Welcome to Gwion
+
+gwion is a easy yet powerful, 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:
+
+@``` helloworld.gw
+<<< "Hello, World!" >>>;
+@```
+@exec make -s CONTAINS="Hello, World!" helloworld.test
+
+## (Bag of) Features
+ * [single inheritance](https://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming)#Design_constraints)
+ * typedef (function pointers and type aliases)
+ * enums and unions
+ * templates (both class and functions)
+ * easy concurrency/async
+ * [lambdas](Reference/Functions/Lambdas.html)
+ * memoization
+ * [variadic](Reference/Functions/Variadic.html) functions
--- /dev/null
+index.md
+
+Overview
+Reference
+Contributing
+
+Benchmarks.md
+BuildingTheDocs.md
--- /dev/null
+#!/bin/sh
+toml() {
+cat <<EOF > book.toml
+[book]
+authors = ["Jérémie Astor"]
+title = "Gwion"
+
+[output.html]
+additional-css = ["custom.css"]
+
+[output.html.fold]
+enable = true
+level = 0
+EOF
+}
+
+css() {
+cat <<EOF > src/custom.css
+.mdr {
+ color:var(--sidebar-active);
+ background-color:var(--sidebar-bg);
+ border: 5px solid var(--sidebar-fg);
+ padding: 10px;
+ margin-right: 20%;
+ margin-left: 20%;
+ moz-border-radius: 15px;
+ -webkit-border-radius: 15px;
+}
+
+footer {
+ text-align: center;
+ font-size: small;
+ font-style: italic;
+}
+EOF
+}
+[ -d src ] || sh scripts/mdr2mdbook.sh
+
+[ -f src/SUMMARY.md ] || sh scripts/summary.sh > src/SUMMARY.md
+
+[ -f book.toml ] || toml
+
+[ -f src/custom.css ] || css
--- /dev/null
+footer() {
+ cat << EOF
+
+<!-- added by doc2src.sh -->
+<footer>
+built with <a href="https://github.com/rust-lang/mdBook/">mdBook</a></br>
+You'll find the source <a href="https://github.com/fennecdjay/Gwion">here</a>, Luke!
+</footer>
+EOF
+}
+
+mk_target() {
+ sed 's/```\(.*\)gw/```\1cpp/' $1
+ footer
+}
+
+ensure_dir() {
+ mkdir -p $(dirname $1)
+}
+
+doc2src() {
+ mdr $1 || return
+ mdfile=${1::-1}
+ target=$(sed 's/docs/src/' <<< $mdfile)
+ ensure_dir $target
+ mk_target $mdfile > $target
+ rm $mdfile
+}
+
+runall() {
+ list=$(find docs -type f -name "*.mdr")
+ for file in $list
+ do doc2src "$file"
+ done
+}
+
+if [ $1 ]
+then doc2src $1
+else runall
+fi
--- /dev/null
+run() {
+ mdbook serve&
+ while true
+ do sh scripts/watch.sh
+ done
+}
+
+clean() {
+ trap - SIGINT SIGTERM ERR; killall mdbook
+ exit 1
+}
+
+trap clean SIGINT SIGTERM ERR; run
--- /dev/null
+#!/bin/sh
+
+# print the offset
+tabulate() {
+ for i in $(seq 1 $1)
+ do printf " "
+ done
+}
+
+sign() {
+ [ "$1" -eq 1 ] && echo "- "
+}
+
+# add an entry to symmary
+entry() {
+ title=$(head -n1 ${1}/${2}r)
+ if [ "$2" = "index.md" ] && [ $3 -gt 0 ]
+ then idx=$(($4-1))
+ else idx=$4
+ fi
+ tabulate $idx
+ if [ $1 = "docs" ]
+ then dir="."
+ else dir=$(sed 's#docs/##' <<< ${1})
+ fi
+ echo "$(sign $3)[${title:2}]($dir/$2)"
+}
+
+# handle a directory
+handle() {
+ while read -r line
+ do
+ if [ -z "$line" ]
+ then echo ""
+ continue
+ fi
+ if [ -f "$1/${line}r" ]
+ then entry $1 $line $2 $(( $3 + 1 ))
+ elif [ -d "$1/${line}" ]
+ then handle $1/$line 1 $(( $3 + 1 ))
+ fi
+ done < "${1}/list"
+}
+
+handle docs 0 -1
--- /dev/null
+NOTERM_OK="✔"
+NOTERM_NOT_OK="✘"
+
+# terminal status
+INTERM_OK="\033[32mOK\033[0m"
+INTERM_NOT_OK="\033[31mNOT OK\033[0m"
+
+check() {
+ for a in $@;
+ do grep "$a" log >/dev/null || return 1
+ done #&& [ -z "${VALGRIND}" ] || return valgrind_parse vlog
+}
+
+interm() {
+ cat log; check $@ && printf "${INTERM_OK}\n" || printf "${INTERM_NOT_OK}\n"
+}
+
+noterm() {
+ echo '<p class="mdr">'
+ cat log
+ echo "</br>"
+ check $@ && printf "${NOTERM_OK}\n" || printf "${NOTERM_NOT_OK}\n"
+ echo '</p>'
+
+}
+
+${VALGRIND} ${VALGRIND_OPT} gwion "$1" &> log
+shift
+[ -t 1 ] && interm $@ || noterm $@
--- /dev/null
+#!/bin/sh
+
+wait() {
+ inotifywait -q -r docs --format "%w%f" | tail -1
+}
+
+while true
+do [[ $1 == *".mdr" ]] &&
+ sh scripts/mdr2mdbook.sh $(wait);
+done