Skip to content

Commit

Permalink
FIX readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ts-thomas committed Jan 11, 2020
1 parent 736f9de commit ff50261
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 45 deletions.
1 change: 1 addition & 0 deletions .babelrc
Expand Up @@ -37,6 +37,7 @@
],
"ignore": [
"config.js",
"bundle.js",
"export.js"
],
"minified": true,
Expand Down
40 changes: 20 additions & 20 deletions README.md
Expand Up @@ -674,7 +674,7 @@ Constructor:

Global methods:

- <a href="#mikado.new">Mikado.**new**(\<root\>, template, \<options\>)</a> : view
- <a href="#mikado.new">Mikado(\<root\>, template, \<options\>)</a> : view
- <a href="#mikado.once">Mikado.**once**(root, template, \<data\>, \<payload\>, \<callback\>)</a>
- <a href="#mikado.register">Mikado.**register**(template)</a>
- <a href="#mikado.unload">Mikado.**unregister**(template)</a>
Expand Down Expand Up @@ -1016,7 +1016,7 @@ var tpl = Mikado.compile(document.getElementById("user-list"));
Create a mikado view:

```js
var view = Mikado.new(tpl);
var view = new Mikado(tpl);
```

<a name="compiler-string"></a>
Expand Down Expand Up @@ -1047,7 +1047,7 @@ var tpl = Mikado.compile(template);
Create a mikado view:

```js
var view = Mikado.new(tpl);
var view = new Mikado(tpl);
```

<a name="started"></a>
Expand Down Expand Up @@ -1079,7 +1079,7 @@ Load library and initialize template (ES5):
<script src="mikado.min.js"></script>
<script src="user/list.js"></script>
<script>
var view = Mikado.new("template");
var view = Mikado("template");
</script>
```

Expand All @@ -1091,7 +1091,7 @@ Load library and initialize template (ES6):
<script type="module">
import Mikado from "./mikado.js";
import template from "./user/list.es6.js";
var view = Mikado.new(template);
var view = Mikado(template);
</script>
```

Expand All @@ -1105,7 +1105,7 @@ view.render(data);
You can also chain methods:

```js
var view = Mikado.new(template)
var view = Mikado(template)
.mount(document.body)
.render(data);
```
Expand Down Expand Up @@ -1324,7 +1324,7 @@ view.render(data, payload, function() {
To render asynchronously by using promises you need to create the view instance with the **_async_** option flag:

```js
view = Mikado.new(template, { async: true });
view = Mikado(template, { async: true });

view.render(data, payload).then(function() {
console.log("finished.");
Expand Down Expand Up @@ -1467,7 +1467,7 @@ Just provide a template as normal:
along with these options:

```js
var view = Mikado.new(template, { pool: true });
var view = Mikado(template, { pool: true });
```

This will switch Mikado into a "non-keyed" mode where already rendered components will be re-used. Using the pool is optional.
Expand All @@ -1490,7 +1490,7 @@ Add the attribute **_key_** to the **_root element_** of a template (or the root
To make them explicitly keyed also disable reusing:

```js
var view = Mikado.new(template, { reuse: false, pool: false });
var view = Mikado(template, { reuse: false, pool: false });
```

This will switch Mikado into an "explicit keyed" mode (non-shared).
Expand All @@ -1511,7 +1511,7 @@ This is a special mode that uses the shared keyed index exclusively (without poo
along with these options:

```js
var view = Mikado.new(template, { reuse: false, pool: "key" });
var view = Mikado(template, { reuse: false, pool: "key" });
```

This will switch Mikado into an "explicit keyed" mode (shared).
Expand All @@ -1534,7 +1534,7 @@ Add the attribute **_key_** to the **_root element_** of a template:
along with these options:

```js
var view = Mikado.new(template, { pool: true });
var view = Mikado(template, { pool: true });
```

This will switch Mikado into a "cross-shared-keyed" mode.
Expand All @@ -1555,7 +1555,7 @@ You can also use the same strategy from 3. for hybrid mode. But it has the same
along with these options:

```js
var view = Mikado.new(template, { pool: "key" });
var view = Mikado(template, { pool: "key" });
```

This will switch Mikado into an "exclusive-shared-keyed" mode.
Expand Down Expand Up @@ -1659,14 +1659,14 @@ view.reconcile(items);
Create a view from a template with options:

```js
var view = Mikado.new(template, options);
var view = Mikado(template, options);
```

<a name="mikado.new"></a>
Create view from a template with options and also mount it to a target element:

```js
var view = Mikado.new(root, template, options);
var view = Mikado(root, template, options);
```

<a name="view.mount"></a>
Expand Down Expand Up @@ -2530,7 +2530,7 @@ Mikado.load("https://my-site.com/templates/template.json", false);
Assign the template to a new Mikado instance, mount and render:

```js
var view = Mikado.new("template");
var view = Mikado("template");
view.mount(document.body).render(data);
```

Expand Down Expand Up @@ -2580,7 +2580,7 @@ When a template has no dynamic expressions (within curly brackets) which need to
When a template just needs to be rendered once you can create, mount, render, unload and destroy (full cleanup) as follows:

```js
Mikado.new(template)
Mikado(template)
.mount(root)
.render()
.unload() // unload before destroy!
Expand All @@ -2590,7 +2590,7 @@ Mikado.new(template)
Destroy has a parameter flag to automatically unload before destroy:

```js
Mikado.new(root, template)
Mikado(root, template)
.render()
.destroy(true);
```
Expand Down Expand Up @@ -2687,9 +2687,9 @@ let app;
if (DEBUG) {
// development:
Mikado.load("http://localhost:3000/json/path/to/app.html", false);
app = Mikado.new("app");
app = Mikado("app");
} else {
app = Mikado.new(tpl_app);
app = Mikado(tpl_app);
}

// same code follows here ...
Expand All @@ -2711,7 +2711,7 @@ let tpl_app;
})();

// same code follows here ...
const app = Mikado.new(tpl_app);
const app = Mikado(tpl_app);
```

#### Server-Side Rendering (SSR)
Expand Down
2 changes: 1 addition & 1 deletion dist/mikado.debug.js
@@ -1,5 +1,5 @@
/**!
* Mikado.js v0.7.56
* Mikado.js v0.7.57
* Copyright 2019 Nextapps GmbH
* Author: Thomas Wilkerling
* Licence: Apache-2.0
Expand Down
2 changes: 1 addition & 1 deletion dist/mikado.es5.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/mikado.light.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/mikado.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -5,7 +5,7 @@
"homepage": "https://github.com/nextapps-de/mikado/",
"author": "Thomas Wilkerling",
"copyright": "Nextapps GmbH",
"version": "0.7.56",
"version": "0.7.57",
"license": "Apache-2.0",
"keywords": [
"Templating",
Expand Down Expand Up @@ -73,7 +73,7 @@
"babel-plugin-transform-property-literals": "^6.9.4",
"babel-plugin-transform-simplify-comparison-operators": "^6.9.4",
"babel-plugin-transform-undefined-to-void": "^6.9.4",
"google-closure-compiler": "^20191204.0.0-nightly",
"google-closure-compiler": "^20191219.0.0-nightly",
"mikado-compile": "^0.7.53"
}
}
1 change: 0 additions & 1 deletion task/postname.json
@@ -1,5 +1,4 @@
{
"\\[\"new\"\\]": ".new",
"\\[\"register\"\\]": ".register",
"\\[\"unregister\"\\]": ".unregister",
"\\[\"load\"\\]": ".load",
Expand Down

0 comments on commit ff50261

Please sign in to comment.