MooDocs - Mootorial
Using MooDocs is very easy. Follow the short tutorial below to see the general MooDocs workflow in action.
1. Create a MooTools Class.
Create your MooTools class in the following format. MooDocs will find the class and parse it for Implements, Extends, options, events, and method calls.
var MyClass = new Class({
Implements: [Options, Events],
options: {
onStart: $empty,
onLoad: $empty,
option1: true,
option2: false
},
initialize: function(argument1, argument2) {
this.fireEvent('start');
},
method1: function() {
return this;
},
method2: function(argument1) {
this.fireEvent('load');
}
});
Note: Generate MooDocs opens a new preview pane as a Coda bug makes regular new documents uneditable. Simply hit “Edit” to work on the docs.
2. Run MooDocs.
Class: MyClass {#MyClass}
=========================
### Implements:
Options, Events
MyClass Method: constructor {#MyClass:constructor}
---------------------------------------------------
### Syntax:
var myMyClass = new MyClass(argument1, argument2);
### Arguments:
1. argument1 - (**)
2. argument2 - (**)
### Options:
* option1 - (**)
* option2 - (**)
### Events:
* onStart -
* onLoad -
MyClass Method: method1 {#MyClass:method1}
-------------------------------------------
### Syntax:
### Returns:
MyClass Method: method2 {#MyClass:method2}
-------------------------------------------
### Syntax:
### Arguments:
1. argument1 - (**)
3. Fill in the blanks.
Class: MyClass {#MyClass}
=========================
My Class description and details.
### Implements:
Options, Events
MyClass Method: constructor {#MyClass:constructor}
---------------------------------------------------
### Syntax:
var myMyClass = new MyClass(argument1, argument2);
### Arguments:
1. argument1 - (*type*) Argument description.
2. argument2 - (*type*) Argument details.
### Options:
* option1 - (*type*) Option description.
* option2 - (*type*) Option details.
### Events:
* onStart - Executed when class initializes.
* onLoad - Execuded when class is finished loading.
MyClass Method: method1 {#MyClass:method1}
-------------------------------------------
Method 1 description and details.
### Syntax:
myMyClass.method1();
### Returns:
* (*object*) This class instance.
MyClass Method: method2 {#MyClass:method2}
-------------------------------------------
Method 2 description and details.
### Syntax:
myMyClass.method2();
### Arguments:
1. argument1 - (*type*) Argument description.
4. Convert Markdown to HTML
<h1 id="MyClass">Class: MyClass</h1> <p>My Class description and details.</p> <h3>Implements:</h3> <p>Options, Events</p> <h2 id="MyClass:constructor">MyClass Method: constructor</h2> <h3>Syntax:</h3> <pre><code>var myMyClass = new MyClass(argument1, argument2); </code></pre> <h3>Arguments:</h3> <ol> <li>argument1 - (<em>type</em>) Argument description.</li> <li>argument2 - (<em>type</em>) Argument details.</li> </ol> <h3>Options:</h3> <ul> <li>option1 - (<em>type</em>) Option description.</li> <li>option2 - (<em>type</em>) Option details.</li> </ul> <h3>Events:</h3> <ul> <li>onStart - Executed when class initializes.</li> <li>onLoad - Execuded when class is finished loading.</li> </ul> <h2 id="MyClass:method1">MyClass Method: method1</h2> <p>Method 1 description and details.</p> <h3>Syntax:</h3> <pre><code>myMyClass.method1(); </code></pre> <h3>Returns:</h3> <ul> <li>(<em>object</em>) This class instance.</li> </ul> <h2 id="MyClass:method2">MyClass Method: method2</h2> <p>Method 2 description and details.</p> <h3>Syntax:</h3> <pre><code>myMyClass.method2(); </code></pre> <h3>Arguments:</h3> <ol> <li>argument1 - (<em>type</em>) Argument description.</li> </ol>
5. Sprinkle CSS!
Class: MyClass
My Class description and details.
Implements:
Options, Events
MyClass Method: constructor
Syntax:
var myMyClass = new MyClass(argument1, argument2);
Arguments:
- argument1 – (type) Argument description.
- argument2 – (type) Argument details.
Options:
- option1 – (type) Option description.
- option2 – (type) Option details.
Events:
- onStart – Executed when class initializes.
- onLoad – Execuded when class is finished loading.
MyClass Method: method1
Method 1 description and details.
Syntax:
myMyClass.method1();
Returns:
- (object) This class instance.
MyClass Method: method2
Method 2 description and details.
Syntax:
myMyClass.method2();
Arguments:
- argument1 – (type) Argument description.


© 2009