open-ephys / bonsai-onix1-docs

Documentation for the OpenEphys.Onix1 Bonsai package
https://open-ephys.github.io/bonsai-onix1-docs/
Creative Commons Attribution Share Alike 4.0 International
0 stars 2 forks source link

Only some attributes are pulled into the auto-generated api .yaml files #29

Closed cjsha closed 3 weeks ago

cjsha commented 3 months ago

This needs to fix so that I can categorize properties into "Configuration Property" or "Acquisition Property" categories.

For example:

The relevant files for this example are: OpenEphys.Onix.ConfigureHeartbeart.yml (generated locally by docfx metadata command) and ConfigureHeartbeart.cs

cjsha commented 2 months ago

relevant issue in the docfx repo

cjsha commented 1 month ago

After input from the docfx people, I can pull custom attributes into the metadata. They were getting excluded because docfx's default filter excludes attributes define in System.ComponentModel namespace. This can be fixed by manually including the attributes we want to use in the docs in the filter.yml like this:

attributeRules:
- include: # this is necessary to pull our custom attributes into .yml metadata without disabling the docfx default filter
    uidRegex: ^System\.ComponentModel\.(CategoryAttribute|DescriptionAttribute)$
    type: Type 

An alternative would be defining these attributes in another namespace, if possible. For example, it seems that the [Range(min, max)] attribute is defined in the Bonsai namespace so it wasn't getting filtered out. I don't know enough about attributes in C# to know if this is worth considering. In any case, I doubt it because we should mold the docs around the code and not the other way around.

Below is an example of a metadata file that is generated by including the above lines in the filter.yml file. Here you can see what I'm talking about regarding the attribute namespace. Ctrl+F the file for "attributes:" I attached a zip file because github doesn't allow attaching .yml files. OpenEphys.Onix1.ConfigureHeartbeat.zip

jonnew commented 1 month ago

This is a good one to discuss in our next technical meeting.