Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 21, 2025

Overview

Implements automated generation and publishing of comprehensive node documentation to address issue #2034, which requested a way to view all supported filters/functions (nodes) without installing chaiNNer.

Solution

This PR adds a complete documentation generation system that:

  1. Fetches node data from the backend's /nodes API endpoint
  2. Generates structured markdown documentation organized by category and node group with cross-reference links
  3. Automatically publishes to the GitHub Wiki after each release

Implementation Details

Documentation Generation Script (scripts/generate_node_docs.py)

A flexible Python script that creates comprehensive markdown documentation from node data:

  • Multiple input sources: Can connect to a running backend server, auto-start the backend, or read from a JSON file
  • Simplified documentation: Shows categories, node names, and descriptions for easy browsing
  • Cross-reference links: "See Also" sections include clickable markdown links that navigate directly to related nodes' documentation using page and anchor links
  • Organized structure: Groups nodes by category and node group for easy navigation

Example usage:

# Fetch from running server
python scripts/generate_node_docs.py --url http://127.0.0.1:8000

# Auto-start backend and generate docs
python scripts/generate_node_docs.py --start-server

# Generate from cached JSON
python scripts/generate_node_docs.py --file nodes_data.json

Automated GitHub Actions Workflow

The .github/workflows/generate-node-docs.yml workflow:

  • Triggers automatically when a release is published (or via manual dispatch)
  • Process:
    1. Sets up Node.js and Python environments
    2. Installs dependencies and starts the backend server
    3. Fetches fresh node data from the /nodes endpoint
    4. Generates markdown documentation with cross-reference links
    5. Updates the GitHub Wiki with the new documentation

Documentation Structure

Generated files:

  • docs/08--Nodes-Reference.md - Main index with links to all categories
  • docs/nodes/<category_id>.md - One file per category containing node documentation

Each node entry includes:

  • Node name (as a heading)
  • Description (supports multi-paragraph descriptions)
  • "See Also" cross-references with clickable links in the format [Node Name](category_id.md#node-name-anchor)
  • Deprecation warnings (if applicable)

Helper Utilities

  • scripts/fetch_nodes.py - Standalone utility to fetch and save node data to JSON
  • scripts/README.md - Comprehensive documentation for using the scripts

Benefits

Discoverability - Users can browse all available nodes online without installing chaiNNer
Always Current - Documentation automatically updates with each release
Clean & Simple - Focused on categories, nodes, and descriptions for quick reference
Interconnected - Cross-reference links enable easy navigation between related nodes
Developer Friendly - Scripts can be run locally for testing or manual updates
Zero Maintenance - Fully automated workflow requires no manual intervention

Testing

The implementation has been tested with:

  • Mock node data to verify markdown generation produces correct output with proper links
  • Command-line argument parsing and validation
  • Python script compilation checks
  • Verification of cross-reference link generation and anchor formatting

The full end-to-end workflow will be validated when the next release is published.

Files Changed

  • .github/workflows/generate-node-docs.yml (new)
  • .gitignore (updated - exclude generated docs/nodes/ directory)
  • README.md (updated - added reference to Nodes Reference documentation)
  • docs/08--Nodes-Reference.md (new - documentation index)
  • scripts/README.md (new)
  • scripts/fetch_nodes.py (new)
  • scripts/generate_node_docs.py (new)

Fixes #2034

Original prompt

This section details on the original issue you should resolve

<issue_title>Documentation: list supported filters in a wiki or in the repository</issue_title>
<issue_description>Motivation
Ability to know which filters/functions (nodes) are implemented without installing the software.

Description
In a wiki page or as a markdown file in the repository, list filters and options: e.g. blend modes, shapes of the erode/dilate nodes
It might be a very simple list or a more detailed description: link to existing explanation of what this node does and/or document it with a very simple example (like in the OpenCV documentation)
</issue_description>

<agent_instructions>If we could someone create a way to build our NodeDocumentation (requires the backend to be fully set up) as static markdown, and update the wiki with it after a release (trigger the build via GitHub actions) that would be perfect IMO.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@joeyballentine I would only do this if we could generate markdown files for it automatically and link them to the wiki page. If we have to do it manually, not a chance that will happen as that will be a nightmare to maintain. @RunDevelopment > I would only do this if we could generate markdown files for it automatically and link them to the wiki page. If we have to do it manually, not a chance that will happen as that will be a nightmare to maintain.

Not really. We could automate this. Assuming we host this on a website, we could start the backend fetch /nodes as part of the build process of the website. This would give us access to all the info we need, and automated page generation can follow. I imagine a build process where we first fetch /nodes and write it into a JSON file, and then build the docs pages from that JSON file.</comment_new>
<comment_new>@joeyballentine
Ah well if the requirement isn't a GitHub wiki but rather just docs available online, I was planning on having the existing docs be built into chaiNNer.app. i have an idea for how to do that that I'd like to try </comment_new>
<comment_new>@RunDevelopment

Ah well if the requirement isn't a GitHub wiki but rather just docs available online

That's how I interpreted it. We can do more on our website anyway.</comment_new>
<comment_new>@joeyballentine
That suggestion does not appear to be related to the original post. What exactly are you suggesting we do here?</comment_new>
<comment_new>@joeyballentine
I've always wanted to have some way of downloading models through chaiNNer. If you aren't aware, we actually run OpenModelDB. I did set up a sort of API we'd be able to use for that purpose eventually. If we were to ever do something like that, it would probably just be something like a "Download Model" node where it has a drop-down of compatible models (but even that has its challenges). Anyway, that won't happen for a while regardless. </comment_new>

Fixes #2034


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add documentation for supported filters in repository Add automated node documentation generation and wiki publishing Oct 21, 2025
Copilot AI requested a review from joeyballentine October 21, 2025 14:30
@joeyballentine
Copy link
Member

@copilot we don't need to show the schema ID in this documentation as it is a user-facing documentation. Reference how the frontend currently displays node documentation and make sure it's roughly the same information shown between them.

Copy link
Contributor Author

Copilot AI commented Oct 21, 2025

@copilot we don't need to show the schema ID in this documentation as it is a user-facing documentation. Reference how the frontend currently displays node documentation and make sure it's roughly the...

Updated the documentation generation to match the frontend display. Removed schema ID and icon name from the output since these are internal identifiers not shown to users in the UI. The generated documentation now shows only: node name, description, inputs/outputs with types and descriptions, see also references, and deprecation warnings.

Changes in commit cd73938 (previously) now updated with this commit.

@joeyballentine
Copy link
Member

@copilot it would be nice if the see also section had actual links to the documentation for those nodes. I think that should be possible with page and header links

Copy link
Contributor Author

Copilot AI commented Oct 21, 2025

@copilot it would be nice if the see also section had actual links to the documentation for those nodes. I think that should be possible with page and header links

Added clickable links to the See Also section. The script now creates markdown links in the format [Node Name](category_id.md#node-name-anchor) that link directly to the referenced node's documentation within the appropriate category file.

For example: [Gaussian Blur](image_filter.md#gaussian-blur)

Implemented in the latest commit.

@joeyballentine
Copy link
Member

@copilot Right now it's a bit messy due to the fact that you're printing out the type information for each input and output. I would say let's just hide that information for now.

Copy link
Contributor Author

Copilot AI commented Oct 21, 2025

@copilot Right now it's a bit messy due to the fact that you're printing out the type information for each input and output. I would say let's just hide that information for now.

Removed type information from inputs and outputs. The documentation now shows only the label names without the type annotations, making it cleaner and easier to read.

Before: - **Image** (Image) or - **Radius** (number)
After: - **Image** or - **Radius**

Implemented in the latest commit.

@joeyballentine
Copy link
Member

@copilot I changed my mind. We don't need to list inputs and outputs here. We just need to list categories and what nodes are included, and what each node's description is

Copy link
Contributor Author

Copilot AI commented Oct 22, 2025

@copilot I changed my mind. We don't need to list inputs and outputs here. We just need to list categories and what nodes are included, and what each node's description is

Simplified the documentation to show only categories, node names, and descriptions. Removed the Inputs and Outputs sections entirely. The documentation now provides a clean overview of available nodes organized by category, with cross-reference links in the See Also section where applicable.

Example output:

### Box Blur

Applies a box blur to the image.

---

### Gaussian Blur

Applies a Gaussian blur to the image.

**See Also:**

- [Box Blur](image_filter.md#box-blur)

---

Implemented in the latest commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation: list supported filters in a wiki or in the repository

2 participants