beef up readme and make blog more prominent
This commit is contained in:
parent
5aeb825ce0
commit
7a32c0ea89
4 changed files with 69 additions and 1 deletions
67
README.md
67
README.md
|
|
@ -6,4 +6,69 @@ A Javascript Framework for Building Brilliant Applications
|
|||
|
||||
See the [website](http://lhorie.github.io/mithril) for documentation
|
||||
|
||||
There's also a [blog](http://lhorie.github.io/mithril-blog) and a [mailing list](https://groups.google.com/forum/#!forum/mithriljs)
|
||||
There's also a [blog](http://lhorie.github.io/mithril-blog) and a [mailing list](https://groups.google.com/forum/#!forum/mithriljs)
|
||||
|
||||
---
|
||||
|
||||
## What is Mithril?
|
||||
|
||||
Mithril is a client-side MVC framework - a tool to organize code in a way that is easy to think about and to maintain.
|
||||
|
||||
### Light-weight
|
||||
|
||||
- Only 4kb gzipped, no dependencies
|
||||
- Small API, small learning curve
|
||||
|
||||
### Robust
|
||||
|
||||
- Safe-by-default templates
|
||||
- Hierarchical MVC via components
|
||||
|
||||
### Fast
|
||||
|
||||
- Virtual DOM diffing and compilable templates
|
||||
- Intelligent auto-redrawing system
|
||||
|
||||
---
|
||||
|
||||
## Sample code
|
||||
|
||||
```javascript
|
||||
//namespace
|
||||
var app = {};
|
||||
|
||||
//model
|
||||
app.PageList = function() {
|
||||
return m.request({method: "GET", url: "pages.json"});
|
||||
};
|
||||
|
||||
//controller
|
||||
app.controller = function() {
|
||||
this.pages = app.PageList();
|
||||
|
||||
this.rotate = function() {
|
||||
this.pages.push(this.pages.shift())
|
||||
}.bind(this)
|
||||
};
|
||||
|
||||
//view
|
||||
app.view = function(ctrl) {
|
||||
return [
|
||||
ctrl.pages().map(function(page) {
|
||||
return m("a", {href: page.url}, page.title);
|
||||
}),
|
||||
m("a", {onclick: ctrl.rotate}, "Rotate links")
|
||||
];
|
||||
};
|
||||
|
||||
//initialize
|
||||
m.module(document.getElementById("example"), app);
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Learn more
|
||||
|
||||
- [Tutorial](http://lhorie.github.io/mithril/getting-started.html)
|
||||
- [Differences from Other MVC Frameworks](http://lhorie.github.io/mithril/comparison.html)
|
||||
- [Benchmarks](http://lhorie.github.io/mithril/benchmarks.html)
|
||||
|
|
@ -12,6 +12,7 @@
|
|||
<a href="getting-started.html">Guide</a>
|
||||
<a href="mithril.html">API</a>
|
||||
<a href="community.html">Community</a>
|
||||
<a href="http://lhorie.github.io/mithril-blog">Blog</a>
|
||||
<a href="mithril.min.zip">Download</a>
|
||||
<a href="http://github.com/lhorie/mithril.js" target="_blank">Github</a>
|
||||
</nav>
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
<a href="getting-started.html">Guide</a>
|
||||
<a href="mithril.html">API</a>
|
||||
<a href="community.html">Community</a>
|
||||
<a href="http://lhorie.github.io/mithril-blog">Blog</a>
|
||||
<a href="mithril.min.zip">Download</a>
|
||||
<a href="http://github.com/lhorie/mithril.js" target="_blank">Github</a>
|
||||
</nav>
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
<a href="getting-started.html">Guide</a>
|
||||
<a href="mithril.html">API</a>
|
||||
<a href="community.html">Community</a>
|
||||
<a href="http://lhorie.github.io/mithril-blog">Blog</a>
|
||||
<a href="mithril.min.zip">Download</a>
|
||||
<a href="http://github.com/lhorie/mithril.js" target="_blank">Github</a>
|
||||
</nav>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue