Skip to content

feat: Add per-node subgraph generation for dependency graphs#88

Open
Blackfeather007 wants to merge 10 commits intoPatrickMassot:masterfrom
Blackfeather007:master
Open

feat: Add per-node subgraph generation for dependency graphs#88
Blackfeather007 wants to merge 10 commits intoPatrickMassot:masterfrom
Blackfeather007:master

Conversation

@Blackfeather007
Copy link
Copy Markdown

Summary

This PR adds a subgraph generation feature that creates individual dependency graph pages for each node, showing the node and all its ancestors (dependencies).

Features

  • Add subgraph() method to DepGraph class that returns a new graph containing a node and all its ancestors
  • Generate individual HTML pages (subgraph_<node_id>.html) for each node in the dependency graph
  • Add "View Dependency Graph" link in node modals to navigate to the corresponding subgraph page

Usage

leanblueprint all --subgraph

or

leanblueprint web --subgraph

Remark

This is just a small feature I developed in my formalization project to make the theorems I'm interested in clearer. Hope this helps. 😄

Blackfeather007 and others added 10 commits February 3, 2026 18:42
- Add monkey patching to extend DepGraph class with subgraph() method
- Generate individual subgraph HTML files for each node showing its dependencies
- Add SUBGRAPH_LINK_TPL to display subgraph links in node modals
- Support querying subgraphs via URL (subgraph_{node_id}.html)
- All changes are contained within leanblueprint package, no modifications to plastexdepgraph
- Add checks for dependency graph existence before processing
- Add detailed logging to help diagnose issues
- Fix options access by getting from document.userdata instead of closure
- Add traceback logging for better error debugging
- Log number of graphs found, nodes processed, and files generated
- Remove verbose debug print statements
- Remove detailed section-by-section logging
- Keep only essential info: graph count, node count, and generated file count
- Simplify error handling to single warning message
- Add --subgraph option to 'leanblueprint web' command
- Only generate subgraph HTML files when --subgraph flag is provided
- Use environment variable LEANBLUEPRINT_SUBGRAPH to pass flag to ProcessOptions
- Default behavior (without flag) does not generate subgraphs
fix: parser and trivial graph
@mmasdeu
Copy link
Copy Markdown

mmasdeu commented Apr 17, 2026

I was looking for this feature! I hope that it get merged soon...

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.

3 participants