more documentation tweaks

This commit is contained in:
Leo Horie 2017-01-08 08:21:33 -05:00
parent 74ded82165
commit be27f4d525
6 changed files with 11 additions and 8 deletions

View file

@ -39,6 +39,7 @@ function generate(pathname) {
})
.replace(/\.md/gim, ".html") // fix links
var html = layout
.replace(/\[version\]/, version) // update version
.replace(/\[body\]/, marked(fixed))
.replace(/<h5 id="([^"]+?)">([^<]+?)<\/h5>/gim, function(match, id, text) { // fix anchors
return "<h5 id=\"" + text.toLowerCase().replace(/\.|\[|\]|&quot;|\//g, "") + "\">" + text + "</h5>"

View file

@ -10,7 +10,6 @@
- [Lifecycle methods](lifecycle-methods.md)
- [Keys](keys.md)
- Social
- [Community chat](https://gitter.im/lhorie/mithril.js)
- [Mithril Jobs](https://github.com/lhorie/mithril.js/wiki/JOBS)
- [How to contribute](contributing.md)
- [Credits](credits.md)

View file

@ -20,16 +20,17 @@ If you're new to Javascript or just want a very simple setup to get your feet we
```bash
# 1) install
npm install mithril@rewrite --save
npm install webpack --save
# 2) add this line into the scripts section in package.json
# "scripts": {
# "build": "webpack index.js app.js --watch"
# "build": "webpack src/index.js lib/app.js --watch"
# }
# 3) create an `index.js` file
# 3) create an `src/index.js` file
# 4) create an `index.html` file loading `app.js`
# 4) create an `index.html` file containing `<script src="lib/app.js"></script>`
# 5) run bundler
npm run build

View file

@ -13,7 +13,7 @@
### What is Mithril?
Mithril is a client-side Javascript framework for building Single Page Applications.
It's small (< 8kb gzip), fast and batteries-included.
It's small (< 8kb gzip), fast and provides routing and XHR utilities out of the box.
If you are an experienced developer and want to know how Mithril compares to other frameworks, see the [framework comparison](framework-comparison.md) page.
@ -23,7 +23,7 @@ Note: This introduction assumes you have basic level of Javacript knowledge. If
### Getting started
The easiest way to try out Mithril is to include it from a CDN, and follow this tutorial. It'll cover the majority of the API surface but it'll only take 10 minutes.
The easiest way to try out Mithril is to include it from a CDN, and follow this tutorial. It'll cover the majority of the API surface (including routing and XHR) but it'll only take 10 minutes.
Let's create an HTML file to follow along:

View file

@ -9,10 +9,11 @@
<body>
<header>
<section>
<h1>Mithril</h1>
<h1>Mithril <small>[version]</small></h1>
<nav>
<a href="introduction.html">Guide</a>
<a href="api.html">API</a>
<a href="https://gitter.im/lhorie/mithril.js">Chat</a>
<a href="https://github.com/lhorie/mithril.js">Github</a>
</nav>
</section>

View file

@ -10,6 +10,7 @@ h2 {font-size:22px;margin:30px 0 15px;}
h3 {font-size:20px;margin:30px 0 15px;}
h4 {font-size:18px;margin:15px 0 15px;}
h5 {font-weight:bold;margin:15px 0 15px;}
h1 small {font-size:16px;}
pre,code {background:#eee;font-family:monospace;}
pre {border-left:3px solid #1e5799;overflow:auto;padding:10px 20px;}
code {border:1px solid #ddd;display:inline-block;margin:0 0 1px;padding:3px;white-space:pre;}
@ -26,7 +27,7 @@ hr {border:0;border-bottom:1px solid #ddd;margin:30px 0;}
#signature + p code {padding:3px 10px;}
h1 + ul {margin:40px 0 0 -270px;padding:0;position:absolute;width:250px;}
h1 + ul + hr {display:none;}
h1 + ul li {border-bottom:1px solid #eee;list-style:none;margin:0;padding:0;}
h1 + ul li {list-style:none;margin:0;padding:0;}
h1 + ul li:last-child {border-bottom:0;}
h1 + ul ul {margin:0 0 10px;padding:0 0 0 15px;}
h1 + ul ul li {border:0;}