Skip to content

Commit 7b79319

Browse files
authored
Organize TOC (#136)
* Organize TOC - Dataframes have a dropdown - enums have a drop - remove excess operators from datai/o dropdown * Fix broken references * Address review feedback - Add content to OpenEphys.Onix1 page * Address bparks feedback in review
1 parent 138d2b0 commit 7b79319

9 files changed

+134
-106
lines changed

api/configure.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@ uid: configure
33
title: Configuration Operators
44
---
55

6-
Device configuration operators belong in a top-level chain of operators between [`CreateContext`](xref:OpenEphys.Onix1.CreateContext) and [`StartAcquisition`](xref:OpenEphys.Onix1.StartAcquisition) to configure devices contained by ONIX hardware hubs.
6+
Aggregate configuration operators belong in a top-level chain of operators between
7+
[`CreateContext`](xref:OpenEphys.Onix1.CreateContext) and [`StartAcquisition`](xref:OpenEphys.Onix1.StartAcquisition) to
8+
configure ONIX hardware hubs. These are known as aggregate configuration operators because they configure an aggregation
9+
of devices (also referred to as a hub) on a given headstage, miniscope, breakout board, etc..

api/constants.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
uid: constants
3+
title: Constants
4+
---
5+
6+
These constants are used throughout the <xref:OpenEphys.Onix1> Bonsai package to assign names to numbered values.

api/data-elements.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
uid: data-elements
3+
title: Data Elements
4+
---
5+
6+
Data elements are produced by <xref:OpenEphys.Onix1> Bonsai operators.

api/device-configure.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ uid: device-configure
33
title: Device Configuration Operators
44
---
55

6-
> [!IMPORTANT]
6+
> [!TIP]
77
> Device configuration operators are not recommended for using off-the-shelf Open Ephys hardware. Use aggregate [configuration operators](xref:configure) instead. Aggregate [configuration operators](xref:configure) confer the following benefits:
88
> - The `address` and `name` properties of aggregate configuration operators undergo automatic configuration which reduces the risk of erroneous configuration.
99
> - The workflow is less cluttered with configuration operators as one aggregate configuration operator corresponds to multiple device operators. This improves workflow legibility and expedites the workflow scripting process.

api/overview.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
uid: OpenEphys.Onix1
3+
title: OpenEphys.Onix1
4+
---
5+
6+
`OpenEphys.Onix1` is a Bonsai package containing interfaces for data acquisition and control of ONIX hardware. This section
7+
of the docs is dedicated to facilitate construction of workflows using the OpenEphys.Onix1 package.
8+
9+
In Bonsai, press <kbd>F1</kbd> while an OpenEphys.Onix1 node is selected in the workflow editor to quickly open this reference.

docfx.json

+10-27
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
{
44
"src": [
55
{
6-
"files": [
7-
"src/**.csproj"
8-
]
6+
"files": ["src/**.csproj"]
97
}
108
],
119
"dest": "api",
@@ -19,35 +17,20 @@
1917
"index.md": "landing"
2018
}
2119
},
22-
"content": [
23-
"articles/**.{md,yml}",
24-
"api/**.{md,yml}",
25-
"toc.yml",
26-
"index.md"
27-
],
28-
"resource": [
29-
"logo.svg",
30-
"favicon.png",
31-
"images/**",
32-
"workflows/**"
20+
"content": [
21+
{
22+
"files": ["articles/**.{md,yml}", "api/**.{md,yml}", "toc.yml", "index.md"],
23+
"exclude": ["api/overview.md"]
24+
}
3325
],
26+
"resource": ["logo.svg", "favicon.png", "images/**", "workflows/**"],
3427
"output": "_site",
3528
"overwrite": [
3629
{
37-
"files": [
38-
],
39-
"exclude": [
40-
"obj/**",
41-
"_site/**"
42-
]
30+
"files": ["api/overview.md"]
4331
}
4432
],
45-
"template": [
46-
"default",
47-
"modern",
48-
"template",
49-
"docfx-tools/template"
50-
],
33+
"template": ["default", "modern", "template", "docfx-tools/template"],
5134
"globalMetadata": {
5235
"_enableNewTab": true,
5336
"_enableSearch": true,
@@ -77,4 +60,4 @@
7760
"rules": {
7861
"InvalidBookmark": "suggestion"
7962
}
80-
}
63+
}

template/ManagedReference.html.primary.tmpl

+11-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,14 @@
88

99
{{#isEnum}}
1010
{{>partials/enum}}
11-
{{/isEnum}}
11+
{{/isEnum}}
12+
13+
{{#isNamespace}}
14+
<div>
15+
<h1 data-uid="{{{uid}}}" class="text-break">
16+
{{{title}}}
17+
<a class="header-action link-secondary" title="View source" href="https://github.com/open-ephys/bonsai-onix1/tree/main/OpenEphys.Onix1"><i class="bi bi-code-slash"></i></a>
18+
</h1>
19+
</div>
20+
{{{conceptual}}}
21+
{{/isNamespace}}

template/partials/class.tmpl.partial

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
{{#oe.operator.configureDevice}}
2-
<div class="CAUTION alert alert-danger">
3-
<h5>Caution</h5>
2+
<div class="Important alert alert-info">
3+
<h5>TIP</h5>
44
<p>
5-
This is a device configuration operator. Device configuration operators are not recommended for interfacing with off-the-shelf ONIX hardware. Use <a class="xref" href="configure.html">aggregate configuration operators</a> to do that instead.
6-
</p>
7-
<p>
8-
To understand the benefits of <a class="xref" href="configure.html">aggregate configuration operators</a>, refer to the <a class="xref" href="device-configure.html">device configuration operators</a> page.
5+
This is a device configuration operator. <a class="xref" href="configure.html">Aggregate configuration operators</a> are recommended in lieu of <a class="xref" href="device-configure.html">device configuration operators</a> for interfacing with Open Ephys Onix hardware.
96
</p>
107
</div>
118
{{/oe.operator.configureDevice}}

template/toc.extension.js

+84-70
Original file line numberDiff line numberDiff line change
@@ -8,84 +8,98 @@ exports.preTransform = function (model) {
88
if (model.items[0].name === 'OpenEphys.Onix1'){
99
if (model.items[0].items){
1010
itemsItemsLength = model.items[0].items.length;
11-
let items = [{
12-
'name': 'Core Operators',
13-
'href' : 'core.html',
14-
'topicHref': 'core.html',
15-
'topicUid': 'core',
16-
'items': []}, {
17-
'name': 'Configuration Operators',
18-
'href' : 'configure.html',
19-
'topicHref': 'configure.html',
20-
'topicUid': 'configure',
21-
'items': []}, {
22-
'name': 'Data I/O Operators',
23-
'href' : 'dataio.html',
24-
'topicHref': 'dataio.html',
25-
'topicUid': 'dataio',
26-
'items': []}, {
27-
'name': 'Other',
28-
'items': [
11+
let items = [
12+
{
13+
'name': 'Core Operators',
14+
'href' : 'core.html',
15+
'topicHref': 'core.html',
16+
'topicUid': 'core',
17+
'items': []
18+
},
19+
{
20+
'name': 'Configuration Operators',
21+
'href' : 'configure.html',
22+
'topicHref': 'configure.html',
23+
'topicUid': 'configure',
24+
'items': []
25+
},
26+
{
27+
'name': 'Data I/O Operators',
28+
'href' : 'dataio.html',
29+
'topicHref': 'dataio.html',
30+
'topicUid': 'dataio',
31+
'items': []
32+
},
33+
{
34+
'name': 'Data Elements',
35+
'href' : 'data-elements.html',
36+
'topicHref': 'data-elements.html',
37+
'topicUid': 'data-elements',
38+
'items': []
39+
},
40+
{
41+
'name': 'Other',
42+
'topicUid': 'other',
43+
'items':
44+
[
45+
{
46+
'name': 'Device Configuration Operators',
47+
'href' : 'device-configure.html',
48+
'topicHref': 'device-configure.html',
49+
'topicUid': 'device-configure',
50+
'items': []
51+
},
52+
{
53+
'name': 'Constants',
54+
'href' : 'constants.html',
55+
'topicHref': 'constants.html',
56+
'topicUid': 'constants',
57+
'items': []
58+
}
59+
]
60+
}
61+
];
62+
for (let i = 0; i < itemsItemsLength; i++)
63+
{
64+
globalYml = '~/api/' + model.items[0].items[i].topicUid + '.yml';
65+
globalModel = model.__global._shared[globalYml];
66+
if (globalModel?.type === 'class' || globalModel?.type === 'struct')
67+
{
68+
if (model.items[0].items[i].name.includes('CreateContext') || model.items[0].items[i].name.includes('StartAcquisition'))
2969
{
30-
'name': 'Device Configuration Operators',
31-
'href' : 'device-configure.html',
32-
'topicHref': 'device-configure.html',
33-
'topicUid': 'device-configure',
34-
'items': [],
70+
items[0].items.push(model.items[0].items[i]);
3571
}
36-
]
37-
}];
38-
for (let i = 0; i < itemsItemsLength; i++) {
39-
globalYml = '~/api/' + model.items[0].items[i].topicUid + '.yml';
40-
if (model.items[0].items[i].name.includes('Frame') ||
41-
model.items[0].items[i].name.includes('DeviceFactory') ||
42-
model.items[0].items[i].name.includes('ContextTask') ||
43-
model.items[0].items[i].name.includes('DeviceNameConverter') ||
44-
model.items[0].items[i].name.includes('ConfigureDS90UB9x') ||
45-
model.items[0].items[i].name.includes('ConfigureFmcLinkController') ||
46-
model.items[0].items[i].name.includes('DeviceContext') ||
47-
model.items[0].items[i].name.includes('NeuropixelsV2QuadShankElectrode') ||
48-
model.items[0].items[i].name.includes('NeuropixelsV2QuadShankProbeConfiguration') ||
49-
model.items[0].items[i].name.includes('NeuropixelsV1eAdc')){
50-
model.items[0].items[i].hide = true;
51-
}
52-
else if (model.__global._shared[globalYml] && model.__global._shared[globalYml].type === 'enum') {
53-
model.items[0].items[i].hide = true;
54-
}
55-
else {
56-
if (model.__global._shared[globalYml] && model.__global._shared[globalYml].type === 'class'){
57-
const inheritanceLength = model.__global._shared[globalYml].inheritance.length;
58-
device = false;
59-
hub = false;
60-
for (let j = 0; j < inheritanceLength; j++){
61-
if (model.__global._shared[globalYml].inheritance[j].uid === 'OpenEphys.Onix1.SingleDeviceFactory'){
62-
device = true;
63-
}
64-
else if (model.__global._shared[globalYml].inheritance[j].uid === 'OpenEphys.Onix1.MultiDeviceFactory'){
65-
hub = true;
66-
}
67-
}
68-
if (model.items[0].items[i].name.includes('CreateContext') || model.items[0].items[i].name.includes('StartAcquisition')){
69-
items[0].items.push(model.items[0].items[i]);
70-
}
71-
else if (device){
72-
items[3].items[0].items.push(model.items[0].items[i]);
73-
}
74-
else if (hub){
75-
items[1].items.push(model.items[0].items[i]);
76-
}
77-
else {
78-
items[2].items.push(model.items[0].items[i]);
79-
}
72+
else if (globalModel?.inheritance.some(inherited => inherited.uid === 'OpenEphys.Onix1.MultiDeviceFactory'))
73+
{
74+
items[1].items.push(model.items[0].items[i]);
8075
}
76+
else if (globalModel?.inheritance.some(inherited => inherited.uid === 'OpenEphys.Onix1.SingleDeviceFactory'))
77+
{
78+
items[4].items[0].items.push(model.items[0].items[i]);
79+
}
80+
else if ((globalModel.syntax?.content[0].value.includes('ElementCategory.Source') ||
81+
globalModel.syntax?.content[0].value.includes('ElementCategory.Sink') ||
82+
globalModel?.inheritance.some(inherited => inherited.uid.includes('Bonsai.Source')) ||
83+
globalModel?.inheritance.some(inherited => inherited.uid.includes('Bonsai.Sink'))) &&
84+
!globalModel.syntax?.content[0].value.includes('abstract'))
85+
{
86+
items[2].items.push(model.items[0].items[i]);
87+
}
88+
else if (model.items[0].items[i].name.includes('ContextTask') ||
89+
model.items[0].items[i].name.includes('OutputClockParameters') ||
90+
globalModel?.inheritance.some(inherited => inherited.uid === 'OpenEphys.Onix1.DataFrame' || inherited.uid === 'OpenEphys.Onix1.BufferedDataFrame'))
91+
{
92+
items[3].items.push(model.items[0].items[i]);
93+
}
94+
}
95+
else if (globalModel && globalModel.type === 'enum')
96+
{
97+
items[4].items[1].items.push(model.items[0].items[i]);
8198
}
8299
}
83100
model.items[0].items = items;
84101
}
85102
}
86-
// if (model.items[1].name === 'OpenEphys.Onix1.Design'){
87-
// model.items.splice(1, 1);
88-
// }
89103
return model;
90104
}
91105

0 commit comments

Comments
 (0)