Skip to content

Commit 6e854e0

Browse files
committed
Add YAML config for new docs
1 parent d5e57e5 commit 6e854e0

2 files changed

Lines changed: 71 additions & 1 deletion

File tree

USING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ If your model already uses other extensions, then it already has an
1212
`extensions` line in it, so just add `array` to the list.
1313

1414
For more information on using NetLogo extensions,
15-
see the [Extensions Guide](http://ccl.northwestern.edu/netlogo/docs/extensions.html)
15+
see the [Extensions Guide](https://docs.netlogo.org/extensions.html)
1616

1717
### When to Use
1818

documentation.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
extensionName: array
2+
icon: i-material-symbols-data-array
3+
filesToIncludeInManual:
4+
- USING.md
5+
- primitives
6+
markdownTemplate: |2
7+
8+
# NetLogo Array Extension
9+
10+
{{> BUILDING.md}}
11+
12+
{{> USING.md}}
13+
14+
## Primitives
15+
16+
{{#contents}}{{#prims}}
17+
[`{{name}}`](#{{primitive.extensionName}}{{primitive.name}})
18+
{{/prims}}{{/contents}}
19+
20+
{{#primitives}}
21+
{{> primTemplate}}
22+
{{/primitives}}
23+
24+
{{> LICENSE.md}}
25+
primTemplate: |2
26+
27+
### `{{name}}`
28+
29+
{{{description}}}
30+
primitives:
31+
- arguments:
32+
- type: list
33+
description: Reports a new array containing the same items in the same order as the input list.
34+
name: from-list
35+
returns: array
36+
type: reporter
37+
- arguments:
38+
- type: array
39+
- name: index
40+
type: number
41+
description: Reports the item in the given array with the given index (ranging from zero to the length of the array minus one).
42+
name: item
43+
returns: anything
44+
type: reporter
45+
- arguments:
46+
- type: array
47+
- name: index
48+
type: number
49+
- name: value
50+
type: anything
51+
description: |2
52+
53+
Sets the item in the given array with the given index (ranging from zero to the length of the array minus one) to the given value.
54+
55+
Note that unlike the `replace-item` primitive for lists, a new array is not created.
56+
The given array is actually modified.
57+
name: set
58+
type: command
59+
- arguments:
60+
- type: array
61+
description: Reports the length of the given array, that is, the number of items in the array.
62+
name: length
63+
returns: number
64+
type: reporter
65+
- arguments:
66+
- type: array
67+
description: Reports a new list containing the same items in the same order as the given array.
68+
name: to-list
69+
returns: list
70+
type: reporter

0 commit comments

Comments
 (0)