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

Patch to support IncludeWorkflow operators #17

Open
wants to merge 71 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
138ce43
Initial commit of template files
banchan86 Aug 8, 2024
3053524
Delete files not required for API template
banchan86 Aug 14, 2024
3e629e3
Add refactored Bonsai and Mref js extensions
banchan86 Aug 14, 2024
2bd0687
Add back required mref.overwrite.js
banchan86 Aug 14, 2024
0d08ec1
Remove OE specific code from define inputs and outputs
banchan86 Aug 14, 2024
45e03d4
Add missing source link for enums
banchan86 Aug 15, 2024
bebd2e0
Simplify enum processing and strip OE specific code
banchan86 Aug 15, 2024
9a1f75d
Strip OE specific suboperator functions
banchan86 Aug 15, 2024
428370d
Strip inherited members in properties table
banchan86 Aug 15, 2024
56accf5
Revert "Strip inherited members in properties table"
banchan86 Aug 15, 2024
18a26ab
Add doc comments for inherited members property table
banchan86 Aug 15, 2024
b6b75e6
Delete unnecessary conceptual markdown template
banchan86 Aug 15, 2024
6c37c73
Add images and modified code for input/output diagram
banchan86 Aug 15, 2024
c5e70d7
Strip OE specific code from class partial template
banchan86 Aug 15, 2024
1c8e075
Remove operator tables from diagram partial template
banchan86 Aug 15, 2024
a575f78
Replace OE with Bonsai in variable names
banchan86 Aug 15, 2024
10337fd
Remove dataframe ref in defineinputoutput
banchan86 Aug 16, 2024
031e25d
Minor code cleanup, finished conversion of template
banchan86 Aug 16, 2024
1094df6
Add relationships to classes/enums
banchan86 Aug 16, 2024
7904709
Add constructors to classes
banchan86 Aug 16, 2024
6e2ff2a
Refactor defineOperatorType function
banchan86 Aug 19, 2024
2078a6f
Refactor some functions
banchan86 Aug 20, 2024
ebcef62
Refactor functions, add styles.css for template table formatting
banchan86 Aug 22, 2024
a861834
Surface links to Bonsai docs for observables and operators
banchan86 Aug 22, 2024
3000e21
Remove constructors from API pages
banchan86 Aug 22, 2024
74dbb7a
Update readme with installation instructions
banchan86 Aug 22, 2024
5ee6e60
Update README with instructions for operator workflow containers
banchan86 Aug 22, 2024
968ca4a
Update README after decoupling API TOC from API template
banchan86 Aug 23, 2024
0f97d2e
Refactor IO diagram, reduce size
banchan86 Sep 22, 2024
225a16b
Add IncludeWorkflow docfx plugin
banchan86 Oct 13, 2024
c6e574b
Added python script to patch api TOC
banchan86 Oct 14, 2024
bdd8dcd
Modify mref.extension.js to support includeworkflows
banchan86 Oct 18, 2024
bec53dd
Modified python patch to update .manifest
banchan86 Oct 20, 2024
5b413d3
Added namespace.yml modification to includeworkflow python patch
banchan86 Oct 21, 2024
1e44200
Remove C# plugin, add yml generation to python patch
banchan86 Oct 28, 2024
13b8042
Temporarily disable inheritance section in includeworkflow patch
banchan86 Nov 4, 2024
13bbce6
Add missing fields to ensure docfx build successfully
banchan86 Nov 4, 2024
7526c53
Fix operator and property descriptions
banchan86 Nov 6, 2024
50028fc
Extract property descriptions from IncludedWorkflow operators
banchan86 Nov 7, 2024
29461c2
Add property check to prevent unnecessary looping & erroneous overwr…
banchan86 Nov 7, 2024
c23b816
Add function to pull property description from C# files
banchan86 Nov 7, 2024
a36982d
Extract property descriptions from package XML documentation files
banchan86 Nov 8, 2024
f2c16e8
Modify logic to only skip properties if they have a description
banchan86 Nov 8, 2024
2a40d2e
Further improvments to property search in package files
banchan86 Nov 8, 2024
262c407
Improve property processing by keeping track of process properties
banchan86 Nov 8, 2024
f77cc23
Hide properties that have been property mapped
banchan86 Nov 8, 2024
f9d4926
Refine skip properties logic
banchan86 Nov 9, 2024
ff2dd86
Refactor code to improve debuggability, regressions to be fixed
banchan86 Nov 11, 2024
b79243a
Fix several regressions
banchan86 Nov 11, 2024
77844fc
fix remaining regressions in refactored code
banchan86 Nov 12, 2024
4a5aa5a
Make property extraction from CS file more robust
banchan86 Nov 12, 2024
79645f7
Make property extraction from includeworkflow recursive
banchan86 Nov 12, 2024
d05cd1e
Made prop extraction from embedded IncludeWorkflows fully recursive
banchan86 Nov 13, 2024
94fa17a
improve package property extraction logic
banchan86 Nov 13, 2024
86990be
Fix package property extraction
banchan86 Nov 13, 2024
6b3e2ec
Add property extraction logic for subject operators
banchan86 Nov 14, 2024
642e641
Add edge case logic for Format operator
banchan86 Nov 14, 2024
12b955f
Refine handling of edge cases
banchan86 Nov 14, 2024
cfdd306
Add edge case for PropertySource
banchan86 Nov 14, 2024
03841cd
Fix PropertySource extraction logic
banchan86 Nov 14, 2024
5e91e16
Property extraction feature complete: validated with Bonvision
banchan86 Nov 14, 2024
c1f02ca
Minor updates to support Bonsai.ML operators
banchan86 Nov 14, 2024
7a0f41c
Add more Bonsai.ML edge cases tor property extraction
banchan86 Nov 15, 2024
bdeaea5
Improve property matching for cs files with regex
banchan86 Nov 15, 2024
1af1f51
Merge branch 'api-template-includeworkflow' of https://github.com/ban…
banchan86 Nov 15, 2024
a068897
Rename type placeholder: float for clarity
banchan86 Nov 15, 2024
31ddc35
Add Workflow operator class to API template and IncludeWorkflow patch
banchan86 Nov 15, 2024
e602e25
Fix assembly name
banchan86 Nov 16, 2024
c99466c
Add IncludeWorkflow patch instructions to README
banchan86 Nov 16, 2024
d79696c
Remove debugging print statements and clean up code
banchan86 Nov 16, 2024
c101268
Split includeworkflow patch from API-template
banchan86 Nov 16, 2024
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
60 changes: 53 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
# docfx-tools

A docfx template for package documentation, patching the modern template to provide stylesheets and scripts for rendering custom workflow containers with copy functionality.
A repository of docfx tools for Bonsai package documentation:
- Workflow Container Template patching the modern template to provide stylesheets and scripts for rendering custom workflow containers with copy functionality.
- IncludeWorkflow Operator Patch that adds support for Bonsai `IncludeWorkflow` Operators
- Powershell Scripts that automate several content generation steps for package documentation websites.

## How to use
## How to include

To include this template in a docfx website, first clone this repository as a submodule:
To include this repo in a docfx website, first clone this repository as a submodule:

```
git submodule add https://github.com/bonsai-rx/docfx-tools bonsai
```

Then modify `docfx.json` to include the template immediately after the modern template:
## Using Workflow Container Template

Modify `docfx.json` to include the template immediately after the modern template:

```json
"template": [
Expand Down Expand Up @@ -39,11 +44,52 @@ export default {
}
```

## Powershell Scripts
## Using IncludeWorkflow Operator Patch

This patch adds support for [IncludeWorkflow](https://bonsai-rx.org/docs/api/Bonsai.Expressions.IncludeWorkflowBuilder.html) operators if they are included in your package. This patch requires a [Python](https://www.python.org/) installation and the [PyYAML](https://pypi.org/project/PyYAML/) package.

1) Assuming you already have `Python` installed, install pyyaml:

```cmd
pip install pyyaml
```

2) Instead of running `dotnet docfx` which executes the standard `docfx` pipeline, run these commands instead to inject the patch:

```cmd
cd docs
dotnet docfx metadata
python bonsai/template/api/plugins/Patch-IncludeWorkflow.py
dotnet docfx build
dotnet docfx serve _site
```

This repository also provides helper scripts to automate several content generation steps for package documentation websites.
- The `metadata` command generates [.yaml](https://dotnet.github.io/docfx/docs/dotnet-yaml-format.html) files for standard operators (C# .cs files) as well as the table of contents (TOC).
- The `Patch-IncludeWorkflow.py` file generates `.yaml` files for `IncludeWorkflow` .bonsai operators and modifies the TOC.
- The `build` command generates `.html` files from `.yaml` and places them in a `_site` folder in `docs`.
- The `serve` command serves a local preview of the website from `_site`.

3) The `dotnet docfx` command in the `docs/build.ps1` script that is used to build the `docfx` website on GitHub needs to be modified with:

```ps1
dotnet docfx metadata
python ./bonsai/template/api/plugins/Patch-IncludeWorkflow.py
dotnet docfx build
```

4) Lastly, the GitHub Actions recipe `.github/workflows/docs.yml` needs to have these lines added before the execution of the `build.ps1` script.

```yaml
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Setup Pyyaml
run: pip install pyyaml==6.0.2
```

### Exporting workflow images
## Powershell Scripts - Exporting workflow images

Exporting SVG images for all example workflows can be automated by placing all `.bonsai` files in a `workflows` folder and calling the below script pointing to the bin directory to include. A bonsai environment is assumed to be available in the `.bonsai` folder in the repository root.

Expand Down
Loading