From: Jean Privat Date: Mon, 18 Feb 2019 15:20:38 +0000 (-0500) Subject: lib&contrib: add some raw and nitish in READMEs X-Git-Url: http://nitlanguage.org lib&contrib: add some raw and nitish in READMEs nitunit in jenkins did not test READMEs (cf #2313) In order to test them, first fix them! Signed-off-by: Jean Privat --- diff --git a/contrib/model_viewer/README.md b/contrib/model_viewer/README.md index 5c91a58..6eee80c 100644 --- a/contrib/model_viewer/README.md +++ b/contrib/model_viewer/README.md @@ -12,7 +12,7 @@ It renders the earth with an displaced surface, a cloud layer, city lights and P This variation can show more models specified on the command line. - ~~~ + ~~~raw bin/model_viewer [path_to_model ...] ~~~ diff --git a/examples/calculator/README.md b/examples/calculator/README.md index aa93fed..121633b 100644 --- a/examples/calculator/README.md +++ b/examples/calculator/README.md @@ -14,21 +14,21 @@ Portable calculator built using _app.nit_ * Compile and run on the desktop (GNU/Linux and OS X) with: - ~~~ + ~~~raw make bin/calculator ~~~ * Compile for Android and install on a device or emulator with: - ~~~ + ~~~raw make bin/android.apk adb install -r bin/calculator.apk ~~~ * Compile for iOS and run on the simulator with: - ~~~ + ~~~raw make bin/android.app ios-sim launch bin/calculator.app ~~~ diff --git a/lib/app/README.md b/lib/app/README.md index 4baecf4..d69a030 100644 --- a/lib/app/README.md +++ b/lib/app/README.md @@ -163,7 +163,7 @@ The _app.nit_ framework defines three annotations to customize the application p ## Usage Example -~~~ +~~~nitish module my_module is app_name "My App" app_namespace "org.example.my_app" @@ -183,7 +183,7 @@ There is two main ways to achieve this goal: * The mixin option (`-m module`) imports an additional module before compiling. It can be used to load platform specific implementations of the _app.nit_ portable UI. - ~~~ + ~~~raw # GNU/Linux version, using GTK nitc calculator.nit -m linux @@ -198,7 +198,7 @@ There is two main ways to achieve this goal: Continuing with the calculator example, it is adapted for Android by the module `android_calculator.nit`. This module imports both `calculator` and `android`, it can then use Android specific code. - ~~~ + ~~~nitish module android_calculator import calculator diff --git a/lib/gamnit/README.md b/lib/gamnit/README.md index 68370d9..7580370 100644 --- a/lib/gamnit/README.md +++ b/lib/gamnit/README.md @@ -8,20 +8,20 @@ It is based on the portability framework _app.nit_ and the OpenGL ES 2.0 standar To compile the _gamnit_ apps packaged with the Nit repository on GNU/Linux you need to install the dev version of a few libraries and some tools. On Debian 8.2, this command should install everything needed: -~~~ +~~~raw apt-get install libgles2-mesa-dev libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev inkscape ~~~ On Windows 64 bits, using msys2, you can install the required packages with: -~~~ +~~~raw pacman -S mingw-w64-x86_64-angleproject-git mingw-w64-x86_64-SDL2 mingw-w64-x86_64-SDL2_image mingw-w64-x86_64-SDL2_mixer ~~~ While macOS isn't supported, it can create iOS apps. You need to install and setup Xcode, and you may install the GLSL shader validation tool via `brew`: -~~~ +~~~raw brew install glslang ~~~ diff --git a/lib/serialization/README.md b/lib/serialization/README.md index 3f6ac6c..3832465 100644 --- a/lib/serialization/README.md +++ b/lib/serialization/README.md @@ -51,6 +51,8 @@ class Partnership redef fun ==(o) do return o isa SELF and partner_a == o.partner_a and partner_b == o.partner_b redef fun hash do return partner_a.hash + 1024*partner_b.hash end +class Person +end ~~~ ### Scope of the `serialize` annotation @@ -64,7 +66,7 @@ end * A module declaration annotated with `serialize` states that all its class definitions and locally declared attributes are serializable. - ~~~ + ~~~nitish module shared_between_clients is serialize ~~~ @@ -155,7 +157,7 @@ For this customization, the following code snippet implements two serialization services: `User::core_serialize_to` and `Deserializer::deserialize_class`. -~~~ +~~~nitish module user_credentials # User credentials for a website @@ -233,7 +235,7 @@ you must use implementations of `Serializer` and `Deserializer`. The main implementations of these services are `JsonSerializer` and `JsonDeserializer`, from the `json_serialization` module. -~~~ +~~~nitish import json import user_credentials