Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Organize TOC #136

Merged
merged 4 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion api/configure.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ uid: configure
title: Configuration Operators
---

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.
Aggregate configuration operators belong in a top-level chain of operators between
[`CreateContext`](xref:OpenEphys.Onix1.CreateContext) and [`StartAcquisition`](xref:OpenEphys.Onix1.StartAcquisition) to
configure ONIX hardware hubs. These are known as aggregate configuration operators because they configure an aggregation
of devices (also referred to as a hub) on a given headstage, miniscope, breakout board, etc..
6 changes: 6 additions & 0 deletions api/constants.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
uid: constants
title: Constants
---

These constants are used throughout the <xref:OpenEphys.Onix1> Bonsai package to assign names to numbered values.
6 changes: 6 additions & 0 deletions api/data-elements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
uid: data-elements
title: Data Elements
---

Data elements are produced by <xref:OpenEphys.Onix1> Bonsai operators.
2 changes: 1 addition & 1 deletion api/device-configure.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ uid: device-configure
title: Device Configuration Operators
---

> [!IMPORTANT]
> [!TIP]
> 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:
> - The `address` and `name` properties of aggregate configuration operators undergo automatic configuration which reduces the risk of erroneous configuration.
> - 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.
Expand Down
9 changes: 9 additions & 0 deletions api/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
uid: OpenEphys.Onix1
title: OpenEphys.Onix1
---

`OpenEphys.Onix1` is a Bonsai package containing interfaces for data acquisition and control of ONIX hardware. This section
of the docs is dedicated to facilitate construction of workflows using the OpenEphys.Onix1 package.

In Bonsai, press <kbd>F1</kbd> while an OpenEphys.Onix1 node is selected in the workflow editor to quickly open this reference.
37 changes: 10 additions & 27 deletions docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
{
"src": [
{
"files": [
"src/**.csproj"
]
"files": ["src/**.csproj"]
}
],
"dest": "api",
Expand All @@ -19,35 +17,20 @@
"index.md": "landing"
}
},
"content": [
"articles/**.{md,yml}",
"api/**.{md,yml}",
"toc.yml",
"index.md"
],
"resource": [
"logo.svg",
"favicon.png",
"images/**",
"workflows/**"
"content": [
{
"files": ["articles/**.{md,yml}", "api/**.{md,yml}", "toc.yml", "index.md"],
"exclude": ["api/overview.md"]
}
],
"resource": ["logo.svg", "favicon.png", "images/**", "workflows/**"],
"output": "_site",
"overwrite": [
{
"files": [
],
"exclude": [
"obj/**",
"_site/**"
]
"files": ["api/overview.md"]
}
],
"template": [
"default",
"modern",
"template",
"docfx-tools/template"
],
"template": ["default", "modern", "template", "docfx-tools/template"],
"globalMetadata": {
"_enableNewTab": true,
"_enableSearch": true,
Expand Down Expand Up @@ -77,4 +60,4 @@
"rules": {
"InvalidBookmark": "suggestion"
}
}
}
12 changes: 11 additions & 1 deletion template/ManagedReference.html.primary.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,14 @@

{{#isEnum}}
{{>partials/enum}}
{{/isEnum}}
{{/isEnum}}

{{#isNamespace}}
<div>
<h1 data-uid="{{{uid}}}" class="text-break">
{{{title}}}
<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>
</h1>
</div>
{{{conceptual}}}
{{/isNamespace}}
9 changes: 3 additions & 6 deletions template/partials/class.tmpl.partial
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
{{#oe.operator.configureDevice}}
<div class="CAUTION alert alert-danger">
<h5>Caution</h5>
<div class="Important alert alert-info">
<h5>TIP</h5>
<p>
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.
</p>
<p>
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.
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.
</p>
</div>
{{/oe.operator.configureDevice}}
Expand Down
154 changes: 84 additions & 70 deletions template/toc.extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,84 +8,98 @@ exports.preTransform = function (model) {
if (model.items[0].name === 'OpenEphys.Onix1'){
if (model.items[0].items){
itemsItemsLength = model.items[0].items.length;
let items = [{
'name': 'Core Operators',
'href' : 'core.html',
'topicHref': 'core.html',
'topicUid': 'core',
'items': []}, {
'name': 'Configuration Operators',
'href' : 'configure.html',
'topicHref': 'configure.html',
'topicUid': 'configure',
'items': []}, {
'name': 'Data I/O Operators',
'href' : 'dataio.html',
'topicHref': 'dataio.html',
'topicUid': 'dataio',
'items': []}, {
'name': 'Other',
'items': [
let items = [
{
'name': 'Core Operators',
'href' : 'core.html',
'topicHref': 'core.html',
'topicUid': 'core',
'items': []
},
{
'name': 'Configuration Operators',
bparks13 marked this conversation as resolved.
Show resolved Hide resolved
'href' : 'configure.html',
'topicHref': 'configure.html',
'topicUid': 'configure',
'items': []
},
{
'name': 'Data I/O Operators',
'href' : 'dataio.html',
'topicHref': 'dataio.html',
'topicUid': 'dataio',
'items': []
},
{
'name': 'Data Elements',
'href' : 'data-elements.html',
'topicHref': 'data-elements.html',
'topicUid': 'data-elements',
'items': []
},
{
'name': 'Other',
'topicUid': 'other',
'items':
[
{
'name': 'Device Configuration Operators',
'href' : 'device-configure.html',
'topicHref': 'device-configure.html',
'topicUid': 'device-configure',
'items': []
},
{
'name': 'Constants',
'href' : 'constants.html',
'topicHref': 'constants.html',
'topicUid': 'constants',
'items': []
}
]
}
];
for (let i = 0; i < itemsItemsLength; i++)
{
globalYml = '~/api/' + model.items[0].items[i].topicUid + '.yml';
globalModel = model.__global._shared[globalYml];
if (globalModel?.type === 'class' || globalModel?.type === 'struct')
{
if (model.items[0].items[i].name.includes('CreateContext') || model.items[0].items[i].name.includes('StartAcquisition'))
{
'name': 'Device Configuration Operators',
'href' : 'device-configure.html',
'topicHref': 'device-configure.html',
'topicUid': 'device-configure',
'items': [],
items[0].items.push(model.items[0].items[i]);
}
]
}];
for (let i = 0; i < itemsItemsLength; i++) {
globalYml = '~/api/' + model.items[0].items[i].topicUid + '.yml';
if (model.items[0].items[i].name.includes('Frame') ||
model.items[0].items[i].name.includes('DeviceFactory') ||
model.items[0].items[i].name.includes('ContextTask') ||
model.items[0].items[i].name.includes('DeviceNameConverter') ||
model.items[0].items[i].name.includes('ConfigureDS90UB9x') ||
model.items[0].items[i].name.includes('ConfigureFmcLinkController') ||
model.items[0].items[i].name.includes('DeviceContext') ||
model.items[0].items[i].name.includes('NeuropixelsV2QuadShankElectrode') ||
model.items[0].items[i].name.includes('NeuropixelsV2QuadShankProbeConfiguration') ||
model.items[0].items[i].name.includes('NeuropixelsV1eAdc')){
model.items[0].items[i].hide = true;
}
else if (model.__global._shared[globalYml] && model.__global._shared[globalYml].type === 'enum') {
model.items[0].items[i].hide = true;
}
else {
if (model.__global._shared[globalYml] && model.__global._shared[globalYml].type === 'class'){
const inheritanceLength = model.__global._shared[globalYml].inheritance.length;
device = false;
hub = false;
for (let j = 0; j < inheritanceLength; j++){
if (model.__global._shared[globalYml].inheritance[j].uid === 'OpenEphys.Onix1.SingleDeviceFactory'){
device = true;
}
else if (model.__global._shared[globalYml].inheritance[j].uid === 'OpenEphys.Onix1.MultiDeviceFactory'){
hub = true;
}
}
if (model.items[0].items[i].name.includes('CreateContext') || model.items[0].items[i].name.includes('StartAcquisition')){
items[0].items.push(model.items[0].items[i]);
}
else if (device){
items[3].items[0].items.push(model.items[0].items[i]);
}
else if (hub){
items[1].items.push(model.items[0].items[i]);
}
else {
items[2].items.push(model.items[0].items[i]);
}
else if (globalModel?.inheritance.some(inherited => inherited.uid === 'OpenEphys.Onix1.MultiDeviceFactory'))
{
items[1].items.push(model.items[0].items[i]);
}
else if (globalModel?.inheritance.some(inherited => inherited.uid === 'OpenEphys.Onix1.SingleDeviceFactory'))
{
items[4].items[0].items.push(model.items[0].items[i]);
}
else if ((globalModel.syntax?.content[0].value.includes('ElementCategory.Source') ||
globalModel.syntax?.content[0].value.includes('ElementCategory.Sink') ||
globalModel?.inheritance.some(inherited => inherited.uid.includes('Bonsai.Source')) ||
globalModel?.inheritance.some(inherited => inherited.uid.includes('Bonsai.Sink'))) &&
!globalModel.syntax?.content[0].value.includes('abstract'))
{
items[2].items.push(model.items[0].items[i]);
}
else if (model.items[0].items[i].name.includes('ContextTask') ||
model.items[0].items[i].name.includes('OutputClockParameters') ||
globalModel?.inheritance.some(inherited => inherited.uid === 'OpenEphys.Onix1.DataFrame' || inherited.uid === 'OpenEphys.Onix1.BufferedDataFrame'))
{
items[3].items.push(model.items[0].items[i]);
}
}
else if (globalModel && globalModel.type === 'enum')
{
items[4].items[1].items.push(model.items[0].items[i]);
}
}
model.items[0].items = items;
}
}
// if (model.items[1].name === 'OpenEphys.Onix1.Design'){
// model.items.splice(1, 1);
// }
return model;
}

Expand Down
Loading