From 7a32c0ea899fdf3a8db267b7a8fe4f1b481ce98d Mon Sep 17 00:00:00 2001 From: Leo Horie Date: Fri, 27 Jun 2014 16:07:42 -0400 Subject: [PATCH] beef up readme and make blog more prominent --- README.md | 67 +++++++++++++++++++++++++++++++++++++++++- docs/layout/api.html | 1 + docs/layout/guide.html | 1 + docs/layout/index.html | 1 + 4 files changed, 69 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 193aa167..875c7a64 100644 --- a/README.md +++ b/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) \ No newline at end of file +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) \ No newline at end of file diff --git a/docs/layout/api.html b/docs/layout/api.html index c74da60e..4424f49b 100644 --- a/docs/layout/api.html +++ b/docs/layout/api.html @@ -12,6 +12,7 @@ Guide API Community + Blog Download Github diff --git a/docs/layout/guide.html b/docs/layout/guide.html index d9742e73..24738697 100644 --- a/docs/layout/guide.html +++ b/docs/layout/guide.html @@ -12,6 +12,7 @@ Guide API Community + Blog Download Github diff --git a/docs/layout/index.html b/docs/layout/index.html index 460b5979..d7192c7b 100644 --- a/docs/layout/index.html +++ b/docs/layout/index.html @@ -12,6 +12,7 @@ Guide API Community + Blog Download Github