From 5ba73cc09d761bc2cdee1446bf83b8db0b917ea3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Wed, 30 Oct 2019 09:54:24 +0100 Subject: [PATCH] [DOC] move quick_start into learning/ sub folder --- doc/{ => learning}/quick_start.md | 20 ++++++++++++++------ doc/readme.md | 2 +- 2 files changed, 15 insertions(+), 7 deletions(-) rename doc/{ => learning}/quick_start.md (86%) diff --git a/doc/quick_start.md b/doc/learning/quick_start.md similarity index 86% rename from doc/quick_start.md rename to doc/learning/quick_start.md index 13123160..c3dd58d8 100644 --- a/doc/quick_start.md +++ b/doc/learning/quick_start.md @@ -2,8 +2,17 @@ ## Static Server -Let us assume that we have a static server running somewhere. We could then -simply add an html page with a few extra files. +Let us assume that we have a static server running somewhere. Let us start by +adding an html page with a few extra files: + +``` +my-app/ + index.html + app.css + app.js + owl-X.Y.Z.js + templates.xml +``` ### HTML and CSS @@ -88,10 +97,9 @@ class ClickCounter extends owl.Component { //------------------------------------------------------------------------------ async function start() { const templates = await owl.utils.loadFile("templates.xml"); - const env = { - qweb: new owl.QWeb({ templates }) - }; - const counter = new ClickCounter(env); + const qweb = new owl.QWeb({ templates }); + owl.config.env.qweb = qweb; + const counter = new ClickCounter(); const target = document.getElementById("main"); await counter.mount(target); } diff --git a/doc/readme.md b/doc/readme.md index a8324a3c..af98a1b9 100644 --- a/doc/readme.md +++ b/doc/readme.md @@ -65,7 +65,7 @@ Note that for convenience, the `useState` hook is also exported at the root of t ## Learning Resources -- [Quick Start](quick_start.md) +- [Quick Start: create an (almost) empty Owl application](learning/quick_start.md) ## Miscellaneous