Skip to content

Commit 2e58436

Browse files
committed
A bunch of documentation updates
1 parent 68fb621 commit 2e58436

14 files changed

Lines changed: 184 additions & 176 deletions

doc/markdown/actions.md

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,55 @@
11
<!-- dash: Actions | Guide | ##:Section -->
22

3-
43
# Nitrogen Actions
54

65
## Base Action
76

8-
* [Base Action](action_base.md) - All actions contain these attributes.
7+
- [Base Action](action_base.md) - All actions contain these attributes.
98

109
## Page Manipulation
1110

12-
* [Redirect](redirect.md)
13-
* [Event](event.md)
14-
* [Update](update.md) (includes Update, Replace, Insert Top,
11+
- [Redirect](redirect.md)
12+
- [Event](event.md)
13+
- [Update](update.md) (includes Update, Replace, Insert Top,
1514
Insert Bottom, Insert Before, Insert, After, and Remove)
16-
* [Script](script.md)
17-
* [JS Function](js_fun.md)
18-
* [Open Window](open_window.md)
19-
* [API Actions](action_api.md)
20-
* [Comet Action](comet.md)
15+
- [Script](script.md)
16+
- [JS Function](js_fun.md)
17+
- [Open Window](open_window.md)
18+
- [API Actions](action_api.md)
19+
- [Comet Action](comet.md)
2120

2221
## Forms
2322

24-
* [Set](set.md) | [Set Multiple](set_multiple.md)
25-
* [Disable](disable.md) | [Enable](enable.md)
26-
* [Make Readonly](make_readonly.md) | [Make Writable](make_writable.md)
27-
* [Disable Option](disable_option.md) | [Enable Option](enable_option.md)
28-
* [Add Option](add_option.md) | [[Remove Option](remove_option.md)
29-
* [If Value - Conditional Actions](if_value.md)
23+
- [Set](set.md) | [Set Multiple](set_multiple.md)
24+
- [Disable](disable.md) | [Enable](enable.md)
25+
- [Make Readonly](make_readonly.md) | [Make Writable](make_writable.md)
26+
- [Disable Option](disable_option.md) | [Enable Option](enable_option.md)
27+
- [Add Option](add_option.md) | [[Remove Option](remove_option.md)
28+
- [If Value - Conditional Actions](if_value.md)
3029

3130
## Form Validation
3231

33-
* [Validate](validate.md)
34-
* [Clear Validation](clear_validation.md)
35-
* [Custom Javascript Validation](js_custom.md)
32+
- [Validate](validate.md)
33+
- [Clear Validation](clear_validation.md)
34+
- [Custom Javascript Validation](js_custom.md)
3635

3736
## Effects
3837

39-
* [Show](show.md) | [Hide](hide.md)
40-
* [Appear](appear.md) | [Fade](fade.md)
41-
* [Slide Down](slide_down.md) | [Slide Up](slide_up.md)
42-
* [Toggle](toggle.md)
43-
* [Animate](animate.md)
44-
* [Effect](effect.md)
45-
* [Add Class](add_class.md) | [Remove Class](remove_class.md)
38+
- [Show](show.md) | [Hide](hide.md)
39+
- [Appear](appear.md) | [Fade](fade.md)
40+
- [Slide Down](slide_down.md) | [Slide Up](slide_up.md)
41+
- [Toggle](toggle.md)
42+
- [Animate](animate.md)
43+
- [Effect](effect.md)
44+
- [Add Class](add_class.md) | [Remove Class](remove_class.md)
4645

4746
## Feedback and Debugging
4847

49-
* [Alert](alert.md)
50-
* [Confirm](confirm.md)
51-
* [Browser Console Log](console_log.md)
52-
* [Before Postback](before_postback.md)
48+
- [Alert](alert.md)
49+
- [Confirm](confirm.md)
50+
- [Browser Console Log](console_log.md)
51+
- [Before Postback](before_postback.md)
5352

5453
## See Also
5554

56-
* [Nitrogen Element Paths](paths.md)
55+
- [Nitrogen Element Paths](paths.md)

doc/markdown/before_postback.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
## Before Postback Action - #before_postback {}
1+
## Before Postback Action - `#before_postback{}`
22

33
Adds custom javascript to be executed before every postback is performed on the
44
page.
55

66
### Usage
77

88
```erlang
9-
wf:wire(#before_postback{script="console.log('Sending a postback');"}).
9+
wf:wire(#before_postback{script="console.log('Sending a postback');"}).
1010
```
1111

1212
### Attributes
1313

14-
* `script`: Raw JavaScript to be executed before postback is sent.
14+
- `script`: Raw JavaScript to be executed before postback is sent.
1515

1616
### Notes
1717

1818
The provided script will literally run before every postback on the page.
1919

2020
### See Also
2121

22-
* [base action](./action_base.md)
23-
* [js_fun action](./js_fun.md)
24-
* [script action](./script.md)
25-
22+
- [base action](./action_base.md)
23+
- [`#js_fun` action](./js_fun.md)
24+
- [`#script{}` action](./script.md)
25+
- [Postback Handler](postback.md)

doc/markdown/comet.md

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1+
<!-- dash: #comet{} | Event | ###:Section -->
2+
13
## Comet Action - `#comet{}`
24

35
Enables asynchronous processing with Nitrogen's Comet feature.
46

57
### Usage
68

79
```erlang
8-
wf:wire(#comet{
9-
function = fun comet_loop/0}
10-
pool = my_pool,
11-
scope = local,
12-
}).
13-
14-
comet_loop() ->
15-
wf:update(my_time_element, qdate:to_string("Y-m-d h:i:s")),
16-
wf:flush(),
17-
timer:sleep(1000),
18-
comet_loop().
10+
wf:wire(#comet{
11+
function = fun comet_loop/0}
12+
pool = my_pool,
13+
scope = local,
14+
}).
15+
16+
comet_loop() ->
17+
wf:update(my_time_element, qdate:to_string("Y-m-d h:i:s")),
18+
wf:flush(),
19+
timer:sleep(1000),
20+
comet_loop().
1921
```
2022

2123
This action will start the `comet_loop/0` function in the background as part of
@@ -28,22 +30,22 @@ loops back to itself.
2830

2931
### Attributes
3032

31-
* `function` (function with arity 0) - An Erlang function that executes in the
33+
- `function` (function with arity 0) - An Erlang function that executes in the
3234
background. The function generates actions that are then sent to the browser
3335
via the accumulator.
3436

35-
* `pool` (Atom) - A pool name for the AsyncFunction process.
37+
- `pool` (Atom) - A pool name for the AsyncFunction process.
3638

37-
* `scope` (Atom) - Specifies the scope of the pool. Can be either `local` or
39+
- `scope` (Atom) - Specifies the scope of the pool. Can be either `local` or
3840
`global`. A `local` pool applies only to the current series of page requests
3941
by a user, while a `global` pool applies to the entire system.
4042

41-
* `dying_message` (Any Erlang Term) - A message to be sent to the member functions if
43+
- `dying_message` (Any Erlang Term) - A message to be sent to the member functions if
4244
the function dies.
4345

44-
* `reconnect_actions` (String, Action, or List or Actions) - Nitrogen actions
46+
- `reconnect_actions` (String, Action, or List or Actions) - Nitrogen actions
4547
or JavaScript to be executed when reconnecting to the page after a
46-
disconnection. Typically, it might be something like
48+
disconnection. Typically, it might be something like
4749
`#event{postback=attempt_reconnect}` to trigger a postback to try to
4850
reconnect to the comet.
4951

@@ -54,11 +56,10 @@ or `wf:comet_global`. See Nitrogen's [Function Reference](./api.md)
5456

5557
### See Also
5658

57-
* [base action](./action_base.md)
58-
* [delay_body element](./delay_body)
59-
* [Comet Demo1](https://nitrogenproject.com/demos/comet1)
60-
* [Comet Demo1](https://nitrogenproject.com/demos/comet2)
61-
* [Comet Demo1](https://nitrogenproject.com/demos/comet3)
62-
* [sync_panel demo](https://nitrogenproject.com/demos/sync_panel)
63-
* [delay_body demo](https://nitrogenproject.com/demos/delay_body)
64-
59+
- [base action](./action_base.md)
60+
- [delay_body element](./delay_body)
61+
- [Comet Demo1](https://nitrogenproject.com/demos/comet1)
62+
- [Comet Demo1](https://nitrogenproject.com/demos/comet2)
63+
- [Comet Demo1](https://nitrogenproject.com/demos/comet3)
64+
- [sync_panel demo](https://nitrogenproject.com/demos/sync_panel)
65+
- [delay_body demo](https://nitrogenproject.com/demos/delay_body)
File renamed without changes.

doc/markdown/element_base.md

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,46 @@
11
<!-- dash: Base Element | Guide | ###:Section -->
22

3-
4-
53
## Base Element
64

7-
In object-oriented parlance, all Nitrogen elements are subclasses of
8-
the base element. This means that all Nitrogen elements can use the
9-
attributes listed below.
5+
In object-oriented parlance, all Nitrogen elements are subclasses of
6+
the base element. This means that all Nitrogen elements can use the
7+
attributes listed below.
108

119
### Usage
1210

1311
```erlang
14-
#some_element { id=myElementID, show_if=true, class="someclass", style="border: solid 1px black;" }
15-
12+
#some_element{
13+
id=myElementID,
14+
show_if=true,
15+
class="someclass",
16+
style="border: solid 1px black;"
17+
}
1618
```
1719

1820
### Attributes
1921

20-
* `id` (atom) - The id of the element within the element tree. The id is
21-
used to wire events and to reference the element in client side javascript.
22-
See the Nitrogen wiki for more information.
22+
- `id` (atom) - The id of the element within the element tree. The id is
23+
used to wire events and to reference the element in client side javascript.
24+
See the Nitrogen wiki for more information.
25+
26+
- `actions` (action, list of actions) - The actions to attach to the
27+
element. This can be a single Nitrogen action, or a list of actions.
2328

24-
* `actions` (action, list of actions) - The actions to attach to the
25-
element. This can be a single Nitrogen action, or a list of actions.
29+
- `show_if` (boolean) - If set to true, this element will be rendered.
30+
Otherwise, it will not.
2631

27-
* `show_if` (boolean) - If set to true, this element will be rendered.
28-
Otherwise, it will not.
32+
- `class` (atom or string) - Set the CSS class of the element.
2933

30-
* `class` (atom or string) - Set the CSS class of the element.
34+
- `title` (string) - Set the HTML `title` attribute of the element.
3135

32-
* `title` (string) - Set the HTML `title` attribute of the element.
36+
- `style` (string) - Sets inline CSS style on the element.
3337

34-
* `style` (string) - Sets inline CSS style on the element.
35-
36-
* `html_id` (atom or string) - Sets the HTML `id` attribute of the
37-
element.
38+
- `html_id` (atom or string) - Sets the HTML `id` attribute of the
39+
element.
40+
41+
- `data_fields` (property list) - Sets a series of HTML `data-` fields in
42+
the element. For example, the following `#panel`:
3843

39-
* `data_fields` (property list) - Sets a series of HTML `data-` fields in
40-
the element. For example, the following `#panel`:
41-
4244
```erlang
4345
#panel{
4446
data_fields=[
@@ -48,10 +50,9 @@
4850
}
4951

5052
```
51-
53+
5254
Would produce the following pseudo-HTML:
53-
54-
```html
55-
<div data-ship="bounty" data-action="mutiny"></div>
5655

56+
```html
57+
<div data-ship="bounty" data-action="mutiny"></div>
5758
```

doc/markdown/elements.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
- [Heading 1-6](basic_tag.md)
2727
- [Paragraph](basic_tag.md)
28-
- [Break](br.md)
28+
- [Line Break](br.md)
2929
- [Image](image.md)
3030
- [Hyperlink](link.md) | [Email Hyperlink](email_link.md)
3131
- [Literal](literal.md)
@@ -64,7 +64,7 @@
6464
- [In-Place Textbox](inplace_textbox.md)
6565
- [In-Place Textarea](inplace_textarea.md)
6666
- [Spinner](spinner.md)
67-
- [Quick Form](quickform.md)
67+
- [MISSING Quick Form](quickform.md)
6868

6969
## Mobile Elements
7070

@@ -102,4 +102,3 @@
102102
## See Also
103103

104104
- [Nitrogen Element Paths](paths.md)
105-
- [jQuery Mobile Integration](jquery_mobile_integration.md)

doc/markdown/enable_option.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Enable Option Action - `#enable_option{}`
22

3-
This action tells Nitrogen to enable an item in a #dropdown field.
3+
This action tells Nitrogen to enable an item in a `#dropdown` field.
44

55
### Usage
66

@@ -14,14 +14,12 @@ wf:wire(my_dropdown, #enable_option{value="item_to_enable"}).
1414

1515
### Attributes
1616

17-
* `target` (Element ID) - Which `#dropdown{}` to enable the item from.
18-
* `value` (String) - The value of the `#option` to enable in the
17+
- `target` (Element ID) - Which `#dropdown{}` contains the item you want to
18+
enable.
19+
- `value` (String) - The `value` of the `#option` you wish to enable in the
1920
`#dropdown{}` list.
2021

2122
### See Also
2223

23-
* [base action](./action_base.md)
24-
* [`#disable_option` action](./disable_option.md)
25-
26-
27-
24+
- [base action](./action_base.md)
25+
- [`#disable_option` action](./disable_option.md)

doc/markdown/handler_template.md

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)