From 3b063de082b485ead0a132ad60d70a75c59fe4c3 Mon Sep 17 00:00:00 2001 From: Cory Forsyth Date: Wed, 3 Feb 2016 14:30:47 -0500 Subject: [PATCH] Update ATOMS.md, MOBILEDOC.md --- ATOMS.md | 6 +++--- MOBILEDOC.md | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ATOMS.md b/ATOMS.md index a7baeffee..0961f28d5 100644 --- a/ATOMS.md +++ b/ATOMS.md @@ -15,7 +15,7 @@ An atom is a JavaScript object with 3 *required* properties: The `render` function on an atom is called by an instance of a renderer and passed an object with the following four properties: * `env` [object] - A set of environment-specific properties - * `options` [object] - Rendering options that were passed to the renderer (as `cardOptions`) when it was instantiated + * `options` [object] - Rendering options that were passed to the renderer (as `atomOptions`) when it was instantiated * `payload` [object] - The data payload for this atom from the mobiledoc * `value` [string] - The textual representation to for this atom @@ -27,7 +27,7 @@ must be of the correct type (a DOM Node for the dom renderer, a string of html o `env` always has the following properties: - * `name` [string] - the name of the card + * `name` [string] - the name of the atom * `onTeardown` [function] - The atom can pass a callback function: `onTeardown(callbackFn)`. The callback will be called when the rendered content is torn down. ## Atom Examples @@ -46,7 +46,7 @@ export default { Example dom atom that registers a teardown callback: ```js -let card = { +let atom = { name: 'atom-with-teardown-callback', type: 'dom', render({env, options, value, payload}) { diff --git a/MOBILEDOC.md b/MOBILEDOC.md index 18908eb99..d671a6069 100644 --- a/MOBILEDOC.md +++ b/MOBILEDOC.md @@ -37,19 +37,19 @@ The wrapper signature: ``` { version: "0.3", ──── Versioning information - markups: [ ──── List of markup types + markups: [ ──── Ordered list of markup types markup, markup ], - atoms: [ ──── List of atom types + atoms: [ ──── Ordered list of atom types atom, atom ], - cards: [ ──── List of card types + cards: [ ──── Ordered list of card types card, card ], - sections: [ ──── List of sections. + sections: [ ──── Ordered list of sections. section, section, section @@ -66,7 +66,7 @@ Markups have a tagName, and optionally an array of `attributeName, attributeValu version: "0.3", markups: [ [tagName, optionalAttributes], ──── Markup - ['em'], ──── Example simple markup + ['em'], ──── Example simple markup with no attributes ['a', ['href', 'http://google.com']], ──── Example markup with attributes ] } @@ -125,11 +125,11 @@ Markup sections, in addition to plain text, can include markups and atoms. [1, "p", [ [textTypeIdentifier, openMarkupsIndexes, numberOfClosedMarkups, value], [0, [], 0, "Example with no markup"], ──── textTypeIdentifier for markup is always 0 - [0, [0], 1, "Example wrapped in b tag"], - [0, [1], 0, "Example opening i tag"], - [0, [], 1, "Example closing i tag"], - [0, [1, 0], 1, "Example opening i tag and b tag, closing b tag"], - [0, [], 1, "Example closing b tag"], + [0, [0], 1, "Example wrapped in b tag (opened markup #0), 1 closed markup"], + [0, [1], 0, "Example opening i tag (opened markup with #1, 0 closed markups)"], + [0, [], 1, "Example closing i tag (no opened markups, 1 closed markup)"], + [0, [1, 0], 1, "Example opening i tag and b tag, closing b tag (opened markups #1 and #0, 1 closed markup [closes markup #1])"], + [0, [], 1, "Example closing b tag, (no opened markups, 1 closed markup [closes markup #0])"], ]], [1, "p", [ [textTypeIdentifier, atomIndex, openMarkupsIndexes, numberOfClosedMarkups],