lint docs
This commit is contained in:
parent
56eaba95b5
commit
50d727d017
5 changed files with 11 additions and 8 deletions
|
|
@ -124,8 +124,8 @@ var querystring = m.buildQueryString({a: "1", b: "2"})
|
|||
#### m.withAttr(attrName, callback) - [docs](withAttr.md)
|
||||
|
||||
```javascript
|
||||
var state: {
|
||||
value = ""
|
||||
var state = {
|
||||
value: "",
|
||||
setValue: function(v) {value = v}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@ The easiest way to try out Mithril is to include it from a CDN, and follow this
|
|||
Let's create an HTML file to follow along:
|
||||
|
||||
```markup
|
||||
<div id="root"></div>
|
||||
<body></body>
|
||||
<script src="http://cdn.rawgit.com/lhorie/mithril.js/rewrite/mithril.js"></script>
|
||||
<script>
|
||||
var root = document.getElementById("root")
|
||||
var root = document.body
|
||||
|
||||
// your code goes here!
|
||||
</script>
|
||||
|
|
@ -39,6 +39,8 @@ var root = document.getElementById("root")
|
|||
Let's start as small as well can: render some text on screen. Copy the code below into your file (and by copy, I mean type it out - you'll learn better)
|
||||
|
||||
```javascript
|
||||
var root = document.body
|
||||
|
||||
m.render(root, "Hello world")
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -135,11 +135,11 @@ function traverseDirectory(pathname, callback) {
|
|||
|
||||
//run
|
||||
traverseDirectory("./docs", function(pathname) {
|
||||
if (pathname.indexOf(".md") > -1 && !pathname.match(/migration|zero|simple|node_modules/)) {
|
||||
if (pathname.indexOf(".md") > -1 && !pathname.match(/migration|node_modules/)) {
|
||||
fs.readFile(pathname, "utf8", function(err, data) {
|
||||
if (err) console.log(err)
|
||||
else lint(pathname, data)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
.then(process.exit)
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ Argument | Type | Required | Descr
|
|||
`options.deserialize` | `any = Function(string)` | No | A deserialization method to be applied to the response. Defaults to a small wrapper around `JSON.parse` that returns `null` for empty responses.
|
||||
`options.extract` | `string = Function(xhr, options)` | No | A hook to specify how the XMLHttpRequest response should be read. Useful for reading response headers and cookies. Defaults to a function that returns `xhr.responseText`. If defined, the `xhr` parameter is the XMLHttpRequest instance used for the request, and `options` is the object that was passed to the `m.request` call. If a custom `extract` callback is set, `options.deserialize` is ignored and the string returned from the extract callback will not be parsed as JSON.
|
||||
`options.useBody` | `Boolean` | No | Force the use of the HTTP body section for `data` in `GET` requests when set to `true`, or the use of querystring for other HTTP methods when set to `false`. Defaults to `false` for `GET` requests and `true` for other methods.
|
||||
`options.background` | `Boolean` | No | If `false`, redraws mounted components upon completion of the request. If `true`, it does not. Defaults to `false`.
|
||||
**returns** | `Promise` | | A promise that resolves to the response data, after it has been piped through the `extract`, `deserialize` and `type` methods
|
||||
|
||||
[How to read signatures](signatures.md)
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@
|
|||
Returns an event handler that runs `callback` with the value of the specified DOM attribute
|
||||
|
||||
```javascript
|
||||
var state: {
|
||||
value = ""
|
||||
var state = {
|
||||
value: "",
|
||||
setValue: function(v) {value = v}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue