aboutsummaryrefslogtreecommitdiff
path: root/tools/addon-sdk-1.3/python-lib/cuddlefish/tests/static-files/docs/APIsample.md
blob: 24271ec64fcb05108e26cb02c9ace9ec410ab5b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# Title #

Some text here

<api name="test">
@function
This is a function which does nothing in particular.
@returns {object}
  @prop firststring {string} First string
  @prop firsturl {url} First URL
@param argOne {string} This is the first argument.
@param [argTwo] {bool} This is the second argument.
@param [argThree=default] {uri}
       This is the third and final argument. And this is
       a test of the ability to do multiple lines of
       text.
@param [options] Options Bag
  @prop [style] {string} Some style information.
  @prop [secondToLastOption=True] {bool} The last property.
  @prop [lastOption] {uri}
        And this time we have
        A multiline description
        Written as haiku
</api>

This text appears between the API blocks.

<api name="append">
@function
This is a list of options to specify modifications to your slideBar instance.
@param options
       Pass in all of your options here.
  @prop [icon] {uri} The HREF of an icon to show as the method of accessing your features slideBar
  @prop [html] {string/xml}
        The content of the feature, either as an HTML string,
        or an E4X document fragment.
  @prop [url] {uri} The url to load into the content area of the feature
  @prop [width] {int} Width of the content area and the selected slide size
  @prop [persist] {bool}
        Default slide behavior when being selected as follows:
        If true: blah; If false: double blah.
  @prop [autoReload] {bool} Automatically reload content on select
  @prop [onClick] {function} Callback when the icon is clicked
  @prop [onSelect] {function} Callback when the feature is selected
  @prop [onReady] {function} Callback when featured is loaded
</api>

Wooo, more text.

<api name="cool-func.dot">
@function
@returns {string} A value telling you just how cool you are.
A boa-constructor!
This description can go on for a while, and can even contain
some **realy** fancy things. Like `code`, or even
~~~~{.javascript}
// Some code!
~~~~
@param howMuch {string} How much cool it is.
@param [double=true] {bool}
       In case you just really need to double it.
@param [options] An object-bag of goodies.
  @prop callback {function} The callback
  @prop [random] {bool} Do something random?
@param [onemore] {bool} One more paramater
@param [options2]
       This is a full description of something
       that really sucks. Because I now have a multiline
       description of this thingy.
  @prop monkey {string} You heard me right
  @prop [freak=true] {bool}
        Yes, you are a freak.
</api>

<api name="random">
@function
A function that returns a random integer between 0 and 10.
@returns {int} The random number.
</api>

<api name="empty-class">
@class
This class contains nothing.
</api>

<api name="only-one-ctor">
@class
This class contains only one constructor.
<api name="one-constructor">
@constructor
@param [options] An object-bag of goodies.
</api>
</api>

<api name="two-ctors">
@class
This class contains two constructors.
<api name="one-constructor">
@constructor
The first constructor.
@param [options] An object-bag of goodies.
</api>
<api name="another-constructor">
@constructor
The second constructor.
@param [options] An object-bag of goodies.
</api>
</api>

<api name="ctor-and-method">
@class
This class contains one constructor and one method.
<api name="one-constructor">
@constructor
The first constructor.
@param [options] An object-bag of goodies.
</api>
<api name="a-method">
@method
Does things.
@param [options] An argument.
</api>
</api>

<api name="ctor-method-prop-event">
@class
This class contains one constructor, one method, one property and an event.
<api name="one-constructor">
@constructor
The first constructor.
@param [options] An object-bag of goodies.
</api>
<api name="a-method">
@method
Does things.
@param [options] An argument.
</api>
<api name="a-property">
@property {bool}
Represents stuff.
</api>
<api name="message">
@event
Event emitted when the content script sends a message to the add-on.
@argument {JSON}
The message itself as a JSON-serialized object.
</api>
</api>

<api name="open">
@event
A module-level event called open.
@argument {bool}
Yes, it's open.
</api>

Some more text here, at the end of the file.