docs: load mithril on mithril.js.org

For futzing around in the dev console
This commit is contained in:
Pat Cavit 2017-04-10 23:43:10 -07:00
parent 34d6a710a9
commit 4cfd0c4070
4 changed files with 7 additions and 4 deletions

View file

@ -48,7 +48,7 @@ function generate(pathname) {
var title = fixed.match(/^#([^\n\r]+)/i) || []
var html = layout
.replace(/<title>Mithril\.js<\/title>/, "<title>" + title[1] + " - Mithril.js</title>")
.replace(/\[version\]/, version) // update version
.replace(/\[version\]/g, version) // update version
.replace(/\[body\]/, markedHtml)
.replace(/<h(.) id="([^"]+?)">(.+?)<\/h.>/gim, function(match, n, id, text) { // fix anchors
var anchor = text.toLowerCase().replace(/<(\/?)code>/g, "").replace(/<a.*?>.+?<\/a>/g, "").replace(/\.|\[|\]|&quot;|\/|\(|\)/g, "").replace(/\s/g, "-");

View file

@ -65,6 +65,8 @@ Let's create an HTML file to follow along:
</body>
```
Mithril is also loaded onto this page already, so you can start poking at the `m` object in the developer console right away if you'd like!
---
### Hello world

View file

@ -26,8 +26,9 @@
<small>License: MIT. &copy; Leo Horie.</small>
</section>
</main>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.6.0/prism.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.6.0/components/prism-jsx.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.6.0/prism.min.js" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.6.0/components/prism-jsx.min.js" defer></script>
<script src="https://unpkg.com/mithril@[version]/mithril.js" async></script>
<script>
document.querySelector(".hamburger").onclick = function() {
document.body.className = document.body.className === "navigating" ? "" : "navigating"

View file

@ -1,6 +1,6 @@
{
"name": "mithril",
"version": "1.0.1",
"version": "1.1.1",
"description": "A framework for building brilliant applications",
"author": "Leo Horie",
"license": "MIT",