diff --git a/resources/README.md b/resources/README.md
index 470264bc..9bc74a6d 100644
--- a/resources/README.md
+++ b/resources/README.md
@@ -3,7 +3,7 @@
```bash
$ sudo apt-get install python python-pip # python package manager
$ sudo pip install mkdocs # docs site builder
-$ sudo pip install mkdocs-cinder # theme
+$ sudo pip install mkdocs-material # theme
$ mkdocs serve # make docs available on http://127.0.0.1:8000
$ mkdocs build # build docs static site
diff --git a/resources/docs/css/extra.css b/resources/docs/css/extra.css
index 93522e78..eb5818e0 100644
--- a/resources/docs/css/extra.css
+++ b/resources/docs/css/extra.css
@@ -1,85 +1,2 @@
-body {
-}
-
-a {
- color: #528bff;
-
-}
-
-.text-justify {
- text-align: justify
-}
-
-.navbar-default {
- border-bottom: 1px solid #ddd;
- background: #fafafa;
-}
-
-.navbar-default .navbar-nav a {
- color: #222!important;
-}
-.navbar-toggle span {
- background: #222!important;
-}
-
-.dropdown-menu {
- background: #fafafa!important;
- box-shadow: none;
- border:1px solid #ddd!important;
- margin-top: 0px!important;
-}
-.dropdown-submenu a:after {
- border-left-color:#888!important
-}
-
-.navbar-default .active > a,
-.navbar-default .open > a,
-.navbar-default .navbar-nav a:focus,
-.navbar-default .navbar-nav a:hover,
-.navbar-default .navbar-nav a:active {
- background: #eee!important;
-}
-
-.navbar-brand {
- font-size: 14px;
- text-transform: uppercase;
- font-weight: bold;
- color:#528bff!important;
-}
-
-.navbar-right {
- height: 45px;
-}
-.navbar-right li {
- font-size: 0;
-}
-.navbar-right li i {
- font-size: 14px;
- position: relative;
- top: 4px;
-}
-.navbar-right li.disabled a {
- color:#888!important
-}
-
-.bs-sidebar {
- border-width: 0 1px 0 0;
- box-shadow: none;
- background: none;
-}
-
-.bs-sidebar .nav > li > a {
- padding: 2px 20px;
-}
-
-.bs-sidebar a {
- margin-right: -1px;
- color:inherit;
-}
-
-
-footer {
- font-size:14px;
- line-height: 1;
- margin-bottom: 16px;
-}
+body {overflow-y: scroll}
+.md-nav__title.md-nav__title--site {display: none;}
diff --git a/resources/docs/editing-sessions.md b/resources/docs/editing-sessions.md
new file mode 100644
index 00000000..bfcbd5bb
--- /dev/null
+++ b/resources/docs/editing-sessions.md
@@ -0,0 +1,41 @@
+# Editing sessions
+
+The session editor can be enabled from the sidepanel. Once enabled, clicking on a widget will make it the *selected widget*, adding a fancy dashed blue border to it.
+
+## Root panel
+
+The root panel can be selected by clicking on the "Root" button in the sidepanel.
+
+## Context menu
+
+Right clicking / long touch on a widget or on a tab will also display a context menu providing useful utilities :
+
+- `Edit parent`: selects the widget's parent for edition
+- `Copy`: copy widget's data
+- `Cut`: copy widget's data and delete selected widget
+- `Paste`: paste copied widget in selected container
+ - `n+1` : increments the id of the copied widget (and all its children) before pasting
+ - `Clone` : paste the exact same widget
+- `Add widget`: create a new widget in selected container
+- `Add tab`: create a new tab in selected container
+- `Delete`: delete selected tab or widget
+
+## Save
+
+Current session can be exported as a `.js` file. When overwriting a session file that's currently is use by other clients, they will reload it automatically.
+
+## Load
+
+Loading a session file doesn't affect other clients.
+
+## Grid
+
+By default, widget resizing / dragging snaps to a 10 pixel wide grid. Its width can be customized in the editor (when it's enabled). Setting its width to 1 will disable it. Note that the grid doesn't affect manual setting of a widget's size / position.
+
+## Properties
+
+Selected widget's properties are displayed and can be modified in the sidepanel. The [widgets reference](widgets/widgets) section lists the available properties for each widget type.
+
+## Widget resizing / dragging
+
+Selected widget can be resized using its south, south-east and east handles. It can be dragged with its north-west handle.
diff --git a/resources/docs/user-guide/custom-module.md b/resources/docs/extras/custom-module.md
similarity index 100%
rename from resources/docs/user-guide/custom-module.md
rename to resources/docs/extras/custom-module.md
diff --git a/resources/docs/user-guide/midi.md b/resources/docs/extras/midi.md
similarity index 100%
rename from resources/docs/user-guide/midi.md
rename to resources/docs/extras/midi.md
diff --git a/resources/docs/extras/property-inheritance.md b/resources/docs/extras/property-inheritance.md
new file mode 100644
index 00000000..a21d55cd
--- /dev/null
+++ b/resources/docs/extras/property-inheritance.md
@@ -0,0 +1,17 @@
+# Property inheritance
+
+Widgets can use each other's property values by using the following syntaxes:
+
+- `@{this.propertyName}`
+- `@{parent.propertyName}`
+- `@{widgetId.propertyName}` (where `widgetId` is the target widget's `id`)
+
+It can be used to:
+
+- concatenate strings: `/@{parent.id}/some_suffix`
+- define object value: `["@{parent.id}"]`
+
+If the retreived property is an object (`[] / {}`), it can be used as is or one can retreive a specfic item from it: `@{parent.variables.0}` will try to return the first item of the parent's `variables` property.
+
+!!! note ""
+ The root panel's `id` is `root`.
diff --git a/resources/docs/user-guide/remote-control.md b/resources/docs/extras/remote-control.md
similarity index 68%
rename from resources/docs/user-guide/remote-control.md
rename to resources/docs/extras/remote-control.md
index d2144e69..0c43a15a 100644
--- a/resources/docs/user-guide/remote-control.md
+++ b/resources/docs/extras/remote-control.md
@@ -10,10 +10,11 @@ Apply a set of options to an existing widget by replacing the old ones with the
- `id`: `string`, widget's `id`
-- `options`: `string`, JSON object defining the new properties to merge
+- `options`: `string`, JSON stringified object defining the new properties to merge
- example: `{"label":"New Label", "color":"red"}`
-*Editing a widget can be cpu expensive, hence updating the UI continuously is not a good idea.*
+!!! warning ""
+ Editing a widget can be cpu expensive, hence updating the UI continuously is not a good idea
## `/EDIT_SOFT id options`
@@ -21,10 +22,11 @@ Apply a set of options to an existing widget by merging them to the widget's opt
- `id`: `string`, widget's `id`
-- `options`: `string`, JSON object defining the new properties to merge
+- `options`: `string`, JSON stringified object defining the new properties to merge
- example: `{"label":"New Label", "color":"red"}`
-*Editing a widget can be cpu expensive, hence updating the UI continuously is not a good idea.*
+!!! warning ""
+ Editing a widget can be cpu expensive, hence updating the UI continuously is not a good idea
## `/TABS id id etc`
diff --git a/resources/docs/user-guide/theming.md b/resources/docs/extras/theming.md
similarity index 100%
rename from resources/docs/user-guide/theming.md
rename to resources/docs/extras/theming.md
diff --git a/resources/docs/extras/url-options.md b/resources/docs/extras/url-options.md
new file mode 100644
index 00000000..8f1bd024
--- /dev/null
+++ b/resources/docs/extras/url-options.md
@@ -0,0 +1,20 @@
+# URL Options
+
+Client specific options can be set by adding query parameters to the server's url. One must prepend the url with a question mark (`?`) followed by `parameter=value` pairs separated with ampersands (`&`).
+
+
+| Option | Value | Default | Description |
+|----|----|----|----|
+| hdpi | 1 / 0 | 0 |enable high resolution canvas |
+| doubletab | number | 375 | sets the double tap/click time thershold in milliseconds |
+| zoom | number | 1 | sets the initial zoom |
+
+Example:
+
+`http://server-ip:port?hdpi=1`
+
+
+!!! note ""
+ When using the built-in client, url options can be set through the `--url-options` switch.
+
+ Example: `open-stage-control --url-options zoom=2 doubletap=200`
diff --git a/resources/docs/getting-started.md b/resources/docs/getting-started.md
index 2bc14726..6fde509e 100644
--- a/resources/docs/getting-started.md
+++ b/resources/docs/getting-started.md
@@ -1,99 +1,100 @@
# Getting started
-----
-## Run from binaries
+!!! tip ""
+ Prebuilt binaries for Linux, Windows and OS X can be found on the [release](https://github.com/jean-emmanuel/open-stage-control/releases) page.
-Prebuilt binaries for Linux, Windows and OS X can be found on the [release](https://github.com/jean-emmanuel/open-stage-control/releases) page.
+## Options
+Below are the available command-line options. Note that when running without any command-line switch (ie from a file browser), a launcher window will spawn to help setting them.
-Below are the available command-line switches. Note that when running without any command-line switch (ie from a file browser), a launcher window will spawn to help setting them.
+| Option | Description |
+|---|---|
+| sync | synchronized hosts (ip:port pairs) (osc messages sent by widgets will also be sent to these targets)|
+| load | session file to load |
+| blank | load a blank session and start the editor |
+| custom-module | custom module file to load |
+| port | http port of the server (default to 8080) |
+| osc-port | osc input port (default to --port) |
+| midi | midi router settings (requires python-pyo) |
+| debug | log received osc messages in the console |
+| no-gui | disable default gui |
+| gui-only | app server's url. If true, local port (--port) is used |
+| theme | theme name or path (mutliple values allowed) |
+| examples | list examples instead of recent sessions |
+| url-options | [url options](extras/url-options) (opt=value pairs) |
+| disable-vsync | disable gui's vertical synchronization |
+| read-only | disable session editing and session history changes |
+Command-line only :
-**Options**
-```markdown
- -s, --sync synchronized hosts (ip:port pairs) (osc messages sent by widgets will also be sent to these targets)
- -l, --load session file to load
- -b, --blank load a blank session and start the editor
- -c, --custom-module custom module file to load
- -p, --port http port of the server (default to 8080)
- -o, --osc-port osc input port (default to --port)
- -m, --midi midi router settings (requires python-pyo)
- -d, --debug log received osc messages in the console
- -n, --no-gui disable default gui
- -g, --gui-only app server's url. If true, local port (--port) is used
- -t, --theme theme name or path (mutliple values allowed)
- -e, --examples list examples instead of recent sessions
- --disable-vsync disable gui's vertical synchronization
- --read-only disable session editing and session history changes
-
- -h, --help display help
- -v, --version display version number
-```
+| Option | Description |
+|---|---|
+| help | print available options |
+| version | print version number |
**Examples**
```
-
-$ open-stage-control -s 127.0.0.1:5555 127.0.0.1:6666 -p 7777
+$ open-stage-control --sync 127.0.0.1:5555 127.0.0.1:6666 --port 7777
+```
This will create an app listening on port 7777 for synchronization messages, and sending its widgets state changes to ports 5555 and 6666.
-----
-
-$ open-stage-control -n -l path/to/session.js
-
-This will create a headless app available through http on port 8080. Multiple clients can use the app (with chrome only) simultaneously, their widgets will be synchronized.
+```
+$ open-stage-control --no-gui --load path/to/session.js --port 9999
```
-----
+This will create a headless app available through http on port 9999 with session.js loaded automatically.
+
## Run from sources
Running the app from the sources slightly differs from using built binaries : instead of running a binary, we'll launch the app with npm.
-**Requirements**
+**1. Requirements**
- [Node.js >= 4](https://nodejs.org/)
- [npm](https://www.npmjs.com/)
-```bash
+```
$ sudo apt-get install nodejs npm # install nodejs & npm
$ sudo npm install -g npm # update npm
```
-**Download**
+**2. Download sources**
-```bash
+```
$ git clone https://github.com/jean-emmanuel/open-stage-control
$ cd open-stage-control/
$ npm install
- ```
-
-**Run**
-
-```bash
-$ npm start [ -- options]
-
-# A double hyphen ("--") is used here to tell npm that the following options are to be given to the app.
```
-----
+**3. Run !**
+
+```
+$ npm start [ -- options]
+```
+
+!!! note ""
+ A double hyphen (`--`) is used here to tell npm that the options are to be passed to the app.
+
+
## Build from sources
-**Requirements**
+**1. Requirements**
-- [Node.js](https://nodejs.org/)
+- [Node.js >= 4](https://nodejs.org/)
- [npm](https://www.npmjs.com/)
-```bash
-$ sudo apt-get install npm # install nodejs & npm
+```
+$ sudo apt-get install nodejs npm # install nodejs & npm
$ sudo npm install -g npm # update npm
```
-**Build**
+**2. Build**
-```bash
+```
$ git clone https://github.com/jean-emmanuel/open-stage-control
$ cd open-stage-control
$ npm install
@@ -101,25 +102,30 @@ $ export PLATFORM=TARGET_PLATFORM # TARGET_PLATFORM can be linux, win32 (windows
$ export ARCH=TARGET_ARCH # TARGET_ARCH can be ia32, x64 or armv7l
$ npm run build
-$ # Do the following if you want a deb package for debian/ubuntu
+# Do the following if you want a deb package for debian/ubuntu
+
$ npm run deb32
-$ # or
+
+# or
+
$ npm run deb64
-$ # or
+
+# or
+
$ npm run debarm
```
This will build the app in `dist/open-stage-control-PLATFORM-ARCH`.
-*Please note that building the app for windows from a linux system requires wine to be installed.*
+!!! note ""
+ Building the app for windows from a linux system requires wine to be installed.*
-----
-## Running a true headless server
+## Running in a headless context
Electron, Open Stage Control's engine, is based on chromium and can't run out of the box without a display server. However, using a virtual framebuffer does the trick. Detailed instructions can be found in Electron's [documentation](http://electron.atom.io/docs/tutorial/testing-on-headless-ci/).
In short: install [xvfb](https://en.wikipedia.org/wiki/Xvfb) and prepend your command with `xvfb-run`:
-```bash
-xvfb-run open-stage-control -n
+```
+$ xvfb-run open-stage-control -n
```
diff --git a/resources/docs/img/logo-material.svg b/resources/docs/img/logo-material.svg
new file mode 120000
index 00000000..0be1bb38
--- /dev/null
+++ b/resources/docs/img/logo-material.svg
@@ -0,0 +1 @@
+../../images/logo-material.svg
\ No newline at end of file
diff --git a/resources/docs/img/mockup.png b/resources/docs/img/mockup.png
new file mode 100644
index 00000000..2eac316f
Binary files /dev/null and b/resources/docs/img/mockup.png differ
diff --git a/resources/docs/img/screenshot-1.png b/resources/docs/img/screenshot-1.png
deleted file mode 100644
index ee569269..00000000
Binary files a/resources/docs/img/screenshot-1.png and /dev/null differ
diff --git a/resources/docs/img/screenshot-2.png b/resources/docs/img/screenshot-2.png
deleted file mode 100644
index 0f744339..00000000
Binary files a/resources/docs/img/screenshot-2.png and /dev/null differ
diff --git a/resources/docs/index.md b/resources/docs/index.md
index a3bb00fa..849b59df 100644
--- a/resources/docs/index.md
+++ b/resources/docs/index.md
@@ -1,76 +1,9 @@
-
-
-
-
+# Open Stage Control
+Open Stage Control is a libre desktop OSC bi-directionnal control surface application. It's built on web technologies and run as an [Electron](http://electron.atom.io/) web server that accepts any number of clients.
-
- Open Stage Control is a libre desktop OSC bi-directionnal control surface application. It's built with HTML, JavaScript & CSS and run as a Node / Electron web server that accepts any number of Chrome / Chromium / Electron clients.
-