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