Add meta description to docs

This commit is contained in:
Stephan Hoyer 2018-11-27 23:50:45 +01:00
parent c7b56161a5
commit 7b1fda5b66
47 changed files with 540 additions and 267 deletions

View file

@ -1,3 +1,7 @@
<!--meta-description
Approaches you can use to animate your Mithril.js-based apps, including technology and performance suggestions
-->
# Animations
- [Technology choices](#technology-choices)

View file

@ -1,3 +1,7 @@
<!--meta-description
An API cheatsheet for Mithril.js
-->
# API
### Cheatsheet

View file

@ -1,3 +1,7 @@
<!--meta-description
The Mithril.js auto-redraw system re-renders your app after some functions complete. Here, we describe the idiomatic Mithril.js patterns that trigger those redraws.
-->
# The auto-redraw system
Mithril implements a virtual DOM diffing system for fast rendering, and in addition, it offers various mechanisms to gain granular control over the rendering of an application.

View file

@ -1,3 +1,6 @@
<!--meta-description
Documentation on m.buildPathname(), which creates URLs from path templates and query objects
-->
# buildPathname(object)
- [Description](#description)
@ -11,7 +14,7 @@
Turns a [path template](paths.md) and a parameters object into a string of form `/path/user?a=1&b=2`
```javascript
var querystring = m.buildPathname("/path/:id", {id: "user", a: "1", b: "2"})
var pathname = m.buildPathname("/path/:id", {id: "user", a: "1", b: "2"})
// "/path/user?a=1&b=2"
```
@ -19,12 +22,13 @@ var querystring = m.buildPathname("/path/:id", {id: "user", a: "1", b: "2"})
### Signature
`querystring = m.buildPathname(object)`
`pathname = m.buildPathname(object)`
Argument | Type | Required | Description
------------ | ------------------------------------------ | -------- | ---
`object` | `Object` | Yes | A key-value map to be converted into a string
**returns** | `String` | | A string representing the input object
`path` | `String` | Yes | A URL path
`query ` | `Object` | Yes | A key-value map to be converted into a string
**returns** | `String` | | A string representing the URL with the query string
[How to read signatures](signatures.md)
@ -35,7 +39,7 @@ Argument | Type | Required | Descripti
The `m.buildPathname` creates a [path name](paths.md) from a path template and a parameters object. It's useful for building URLs, and it's what [`m.route`](route.md), [`m.request`](request.md), and [`m.jsonp`](jsonp.md) all use internally to interpolate paths. It uses [`m.buildQueryString`](buildQueryString.md) to generate the query parameters to append to the path name.
```javascript
var querystring = m.buildPathname("/path/:id", {id: "user", a: 1, b: 2})
var pathname = m.buildPathname("/path/:id", {id: "user", a: 1, b: 2})
// querystring is "/path/user?a=1&b=2"
// pathname is "/path/user?a=1&b=2"
```

View file

@ -1,3 +1,7 @@
<!--meta-description
Documentation on m.buildQueryString(), which converts an object like {a: "1", b: "2"} into a string like "a=1&b=2"
-->
# buildQueryString(object)
- [Description](#description)
@ -23,7 +27,7 @@ var querystring = m.buildQueryString({a: "1", b: "2"})
Argument | Type | Required | Description
------------ | ------------------------------------------ | -------- | ---
`object` | `Object` | Yes | A key-value map to be converted into a string
`query` | `Object` | Yes | A key-value map to be converted into a string
**returns** | `String` | | A string representing the input object
[How to read signatures](signatures.md)

View file

@ -1,3 +1,7 @@
<!--meta-description
Documentation on m.censor(), which helps cloning vnodes
-->
# censor(object, extra)
- [Description](#description)

View file

@ -1,3 +1,6 @@
<!--meta-description
Official change log for Mithril.js
-->
# Change log
- [v2.0.4](#v204)

View file

@ -1,3 +1,7 @@
<!--meta-description
Code of Conduct Covenant for contributors to the Mithril.js project
-->
# Contributor Covenant Code of Conduct
## Our Pledge

View file

@ -1,3 +1,7 @@
<!--meta-description
Documentation on the structure, lifecycle methods, state management, and syntactic variants of components in Mithril.js
-->
# Components
- [Structure](#structure)

View file

@ -1,3 +1,6 @@
<!--meta-description
Contribution guide for Mithril.js
-->
# Contributing FAQs
- [How do I go about contributing ideas or new features?](#how-do-i-go-about-contributing-ideas-or-new-features?)

View file

@ -1,3 +1,7 @@
<!--meta-description
List of especially notable contributors to Mithril.js
-->
# Credits
Mithril was originally written by Leo Horie, but it is where it is today thanks to the hard work and great ideas of many people.

View file

@ -1,3 +1,6 @@
<!--meta-description
Approaches you can use to integrate ES6 into your Mithril.js-based apps, including technology and usability suggestions
-->
# ES6+ on legacy browsers
- [Setup](#setup)

View file

@ -1,3 +1,7 @@
<!--meta-description
Some examples on how you can use MithrilJS
-->
# Examples
Here are some examples of Mithril in action

View file

@ -1,3 +1,7 @@
<!--meta-description
Documentation on m.fragment(), which allows attaching lifecycle methods and keys to a fragment vnode
-->
# fragment(attrs, children)
- [Description](#description)

View file

@ -1,3 +1,7 @@
<!--meta-description
Detailed comparison between Mithril.js and other popular frameworks
-->
# Framework comparison
- [Why not X?](#why-not-insert-favorite-framework-here?)

View file

@ -1,3 +1,7 @@
<!--meta-description
Documentation on m(), Mithril.js' hyperscript DSL, which you can use to define the views of your app
-->
# m(selector, attributes, children)
- [Description](#description)

View file

@ -1,3 +1,7 @@
<!--meta-description
Mithril.js is a modern, small, fast client-side Javascript framework for building Single Page Applications.
-->
# Introduction
- [What is Mithril?](#what-is-mithril?)

View file

@ -1,3 +1,7 @@
<!--meta-description
Instructions on how to install Mithril.js
-->
# Installation
- [CDN](#cdn)

View file

@ -1,3 +1,7 @@
<!--meta-description
How you can integrate a third party library into a Mithril.js application, using lifecycle methods.
-->
# 3rd Party Integration
Integration with third party libraries or vanilla JavaScript code can be achieved via [lifecycle methods](lifecycle-methods.md).

View file

@ -1,3 +1,7 @@
<!--meta-description
Documentation on m.jsonp(), a utility to fetch data from JSONP APIs
-->
# jsonp(options)
- [Description](#description)

View file

@ -1,3 +1,7 @@
<!--meta-description
Explanation, examples, and build notes on how to use JSX in your MithrilJS-apps
-->
# JSX
- [Description](#description)

View file

@ -1,3 +1,7 @@
<!--meta-description
Documentation on the special "key" attribute in Mithril, which tracks vnodes' identities
-->
# Keys
- [What are keys?](#what-are-keys?)

View file

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Mithril.js</title>
@ -8,6 +8,7 @@
<link href="style.css" rel="stylesheet" />
<link rel="icon" type="image/png" sizes="32x32" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="[metaDescription]">
</head>
<body onload="window.requestAnimationFrame(function(){document.getElementById('archive-docs').selectedIndex = 0})" /* handle back navigation */>
<header>

View file

@ -1,3 +1,7 @@
<!--meta-description
Links to Mithril.js learning content
-->
# Learning Resources
Links to Mithril learning content:

View file

@ -1,3 +1,7 @@
<!--meta-description
Documentation on Mithril.js' lifecycle methods/"hooks"
-->
# Lifecycle methods
- [Usage](#usage)

View file

@ -1,3 +1,7 @@
<!--meta-description
Documentation on m.mount(), which binds a Mithril component to a given DOM node
-->
# mount(root, component)
- [Description](#description)

View file

@ -1,3 +1,6 @@
<!--meta-description
Documentation on m.parsePathname(), which parses URLs to path and query object
-->
# parsePathname(string)
- [Description](#description)
@ -23,7 +26,7 @@ var object = m.parsePathname("/path/user?a=1&b=2")
Argument | Type | Required | Description
------------ | -------- | -------- | ---
`string` | `String` | Yes | A URL
`url` | `String` | Yes | A URL
**returns** | `Object` | | A `{path, params}` pair where `path` is the [normalized path](paths.md#path-normalization) and `params` is the [parsed parameters](paths.md#parameter-normalization).
[How to read signatures](signatures.md)

View file

@ -1,3 +1,7 @@
<!--meta-description
Documentation on m.parseQueryString(), which converts a string like "a=1&b=2" into an object like {a: "1", b: "2"}
-->
# parseQueryString(string)
- [Description](#description)

View file

@ -1,3 +1,6 @@
<!--meta-description
Documentation on how to work with paths in Mithril.js
-->
# Path Handling
- [Path types](#path-types)

View file

@ -1,3 +1,7 @@
<!--meta-description
Documentation on Mithril.js' Promise polyfill
-->
# Promise(executor)
- [Description](#description)

View file

@ -1,3 +1,7 @@
<!--meta-description
Documentation on m.redraw(), which schedules an update of all components mounted via m.mount()
-->
# redraw()
- [Description](#description)

View file

@ -1,3 +1,7 @@
<!--meta-description
Describes how we do releases of Mithril.js
-->
# Mithril Release Processes
**Note** These steps all assume that `MithrilJS/mithril.js` is a git remote named `mithriljs`, adjust accordingly if that doesn't match your setup.

View file

@ -1,3 +1,7 @@
<!--meta-description
Documentation on m.render(), which Mithril.js uses to efficiently patch real DOM trees with virtual DOM nodes
-->
# render(element, vnodes)
- [Description](#description)

View file

@ -1,3 +1,7 @@
<!--meta-description
Documentation on m.request(), a utility for making XHR/AJAX requests
-->
# request(options)
- [Description](#description)

View file

@ -1,3 +1,7 @@
<!--meta-description
Documentation on m.route(), Mithril.js' client-side router
-->
# route(root, defaultRoute, routes)
- [Description](#description)

View file

@ -1,3 +1,7 @@
<!--meta-description
Describes, how to read the signatures in Mithril.js' documentation.
-->
# How to read signatures
Signature sections typically look like this:

View file

@ -1,3 +1,7 @@
<!--meta-description
A complete walkthrough tutorial for building your first simple application in Mithril, from beginning to end
-->
# Simple application
Let's develop a simple application that shows off how to do most of the major things you would need to deal with while using Mithril.

View file

@ -1,3 +1,7 @@
<!--meta-description
Documentation on m.stream(), a reactive data structure provided optionally within Mithril.js
-->
# stream()
- [Description](#description)

View file

@ -1,3 +1,7 @@
<!--meta-description
Where to find help with problems related to MithrilJS
-->
# Getting Help
Mithril has an active & welcoming community on [Gitter](https://gitter.im/mithriljs/mithril.js), or feel free to ask questions on [Stack Overflow](https://stackoverflow.com/questions/tagged/mithril.js) using the `mithril.js` tag.

View file

@ -1,3 +1,7 @@
<!--meta-description
Approaches you can use to testing your Mithril.js-based apps, including technology and usability suggestions
-->
# Testing
- [Setup](#setup)

View file

@ -1,3 +1,7 @@
<!--meta-description
Documentation on m.trust(), a utility for rendering raw HTML and SVG within Mithril, along with tips on when to (and not to) use it
-->
# trust(html)
- [Description](#description)

View file

@ -1,3 +1,7 @@
<!--meta-description
Documentation on Mithril.js' virtual DOM nodes (vnodes) and how they work
-->
# Virtual DOM nodes
- [What is virtual DOM](#what-is-virtual-dom)