diff --git a/docs/components.md b/docs/components.md index b005149e..4dca1cc0 100644 --- a/docs/components.md +++ b/docs/components.md @@ -9,7 +9,7 @@ Components are a mechanism to encapsulate parts of a view to make code easier to organize and/or reuse. -Any Javascript object that has a view method is a Mithril component. Components can be consumed via the [`m`](hyperscript.md) utility: +Any Javascript object that has a view method is a Mithril component. Components can be consumed via the [`m()`](hyperscript.md) utility: ```javascript var Example = { diff --git a/docs/hyperscript.md b/docs/hyperscript.md index 7556c353..7c66c5a8 100644 --- a/docs/hyperscript.md +++ b/docs/hyperscript.md @@ -34,7 +34,7 @@ Argument | Type | Required | Descripti ### How it works -Mithril provides a hyperscript function `m`, which allows expressing any HTML structure using javascript syntax. It accepts a `selector` string (required), an `attributes` object (optional) and a `children` array (optional). +Mithril provides a hyperscript function `m()`, which allows expressing any HTML structure using javascript syntax. It accepts a `selector` string (required), an `attributes` object (optional) and a `children` array (optional). ```javascript var m = require("mithril") @@ -45,7 +45,7 @@ m("div", {id: "box"}, "hello") //
hello
``` -The `m` function does not actually return a DOM element. Instead it returns a [virtual DOM node](vnodes.md), or *vnode*, which is a javascript object that represents the DOM element to be created. +The `m()` function does not actually return a DOM element. Instead it returns a [virtual DOM node](vnodes.md), or *vnode*, which is a javascript object that represents the DOM element to be created. ```javascript //a vnode @@ -64,7 +64,7 @@ Calling `m.render()` multiple times does **not** recreate the DOM tree from scra ### Flexibility -The `m` function is both *polymorphic* and *variadic*. In other words, it's very flexible in what it expects as input parameters: +The `m()` function is both *polymorphic* and *variadic*. In other words, it's very flexible in what it expects as input parameters: ```javascript //simple tag @@ -91,7 +91,7 @@ m("ul", //