From 7473d4570057b22d15cec59d7e34a814bba50da7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Wed, 27 Mar 2019 15:36:09 +0100 Subject: [PATCH] doc: update readme to add a minimal hello world --- README.md | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 06014855..ab51757f 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,23 @@ Note that the test scripts also run the example tests suites. # Examples -There are two examples of how to work with this web framework: +Here is a minimal Hello World example: -- [Demo Application](examples/readme.md#demo) +```javascript +class HelloWorld extends owl.core.Component { + inlineTemplate = `
Hello
`; +} + +const env = { + qweb: new owl.core.QWeb() +}; + +const hello = new HelloWorld(env, { name: "World" }); +hello.mount(document.body); +``` + +More interesting examples on how to work with this web framework can be found in the _examples/_ folder: + +- [Todo Application](examples/readme.md#todo-app) - [Web Client](examples/readme.md#web-client-example) +- [Benchmarks](examples/readme.md#benchmarks)