Skip to content

Commit 298d373

Browse files
TheSmallPixelclaude
andcommitted
docs: rewrite README in product-page format and add CHANGELOG
README now has: badges (CI, release, license, .NET, stars), live demo link, problem statement, 30-second YAML example, inputs table, architecture overview, and development instructions. CHANGELOG seeded with an [Unreleased] section covering the current polish pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c583c18 commit 298d373

3 files changed

Lines changed: 117 additions & 31 deletions

File tree

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Changelog
2+
3+
All notable changes to this project are documented here.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
### Added
11+
- MIT license, contributing guide, issue and PR templates.
12+
- CI workflow that builds the analyzer and runs xUnit tests on every push and PR.
13+
- README rewritten in product-page format with badges, inputs table, and architecture overview.
14+
- `.gitignore` covering .NET, IDE, OS, and editor-backup artifacts.
15+
16+
### Changed
17+
- Action runtime upgraded to .NET 8 LTS (was .NET 7, out of support).
18+
- `actions/checkout` and `actions/setup-dotnet` bumped to v4.
19+
20+
### Removed
21+
- Tracked macOS metadata (`.DS_Store`) and editor backup (`docs/enhanced_visualizer.js.backup`).

README.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
<h1 align="center">GraphCSharp</h1>
2+
3+
<p align="center">
4+
<strong>Visualize any C# codebase as an interactive D3 graph — drop one GitHub Action into your repo.</strong>
5+
</p>
6+
7+
<p align="center">
8+
<a href="https://github.com/TheSmallPixel/GraphCSharp/actions/workflows/ci.yml"><img src="https://github.com/TheSmallPixel/GraphCSharp/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
9+
<a href="https://github.com/TheSmallPixel/GraphCSharp/releases/latest"><img src="https://img.shields.io/github/v/release/TheSmallPixel/GraphCSharp" alt="Release"></a>
10+
<a href="LICENSE"><img src="https://img.shields.io/github/license/TheSmallPixel/GraphCSharp" alt="License"></a>
11+
<img src="https://img.shields.io/badge/.NET-8.0-512BD4" alt=".NET 8">
12+
<a href="https://github.com/TheSmallPixel/GraphCSharp/stargazers"><img src="https://img.shields.io/github/stars/TheSmallPixel/GraphCSharp?style=social" alt="Stars"></a>
13+
</p>
14+
15+
<p align="center">
16+
<a href="https://thesmallpixel.github.io/GraphCSharp/"><strong>→ Open the live demo</strong></a>
17+
</p>
18+
19+
<!-- TODO(media): replace with docs/demo.gif showing the interactive graph in action -->
20+
![Demo](docs/demo.gif)
21+
22+
## What it does
23+
24+
Reading C# architecture from a folder tree is slow. Roslyn can extract the real call graph, but wiring it up — analyzer, JSON schema, D3 layout, GitHub Pages — is a side-project of its own. **GraphCSharp is that side-project, packaged as a single GitHub Action so any repo gets an interactive graph on every push.**
25+
26+
## 30-second example
27+
28+
Add `.github/workflows/code-graph.yml` to your repo:
29+
30+
```yaml
31+
name: Generate Code Graph
32+
on:
33+
push:
34+
branches: [main]
35+
36+
permissions:
37+
contents: write
38+
39+
jobs:
40+
graph:
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: TheSmallPixel/GraphCSharp@v1
44+
with:
45+
source-path: ./src
46+
docs-dir: docs
47+
commit-changes: 'true'
48+
```
49+
50+
Then enable GitHub Pages on the `docs/` folder. Your live graph appears at `https://<user>.github.io/<repo>/`.
51+
52+
## Inputs
53+
54+
| Name | Default | Description |
55+
| --- | --- | --- |
56+
| `source-path` | `./src` | Directory scanned recursively for `.cs` files. |
57+
| `docs-dir` | `docs` | Where `graph.json` and `index.html` are written. |
58+
| `index-file` | `index.html` | Visualizer HTML filename. Copied from this action if missing. |
59+
| `commit-changes` | `false` | When `true`, commits the generated graph back to your repo. |
60+
61+
## Links
62+
63+
- **Live demo:** https://thesmallpixel.github.io/GraphCSharp/
64+
- **Changelog:** [CHANGELOG.md](CHANGELOG.md)
65+
- **Contributing:** [CONTRIBUTING.md](CONTRIBUTING.md)
66+
- **License:** [LICENSE](LICENSE)
67+
68+
## How it works
69+
70+
1. The action checks out your repo and provisions .NET 8.
71+
2. Builds the Roslyn-based analyzer in `tools/CodeAnalysisTool`.
72+
3. Walks every `.cs` file under `source-path`, emitting nodes (namespaces, classes, methods, properties) and links (containment, calls, inheritance, type usage) as `docs/graph.json`.
73+
4. Drops a D3 visualizer into `docs/index.html` if one isn't already there.
74+
5. Optionally commits both files back so GitHub Pages serves a fresh graph on every push.
75+
76+
## Development
77+
78+
Requires the .NET 8 SDK.
79+
80+
```bash
81+
git clone https://github.com/TheSmallPixel/GraphCSharp
82+
cd GraphCSharp
83+
dotnet test tools/CodeAnalysisTool.Tests/CodeAnalysisTool.Tests.csproj
84+
```
85+
86+
To run the analyzer against any folder of `.cs` files:
87+
88+
```bash
89+
dotnet run --project tools/CodeAnalysisTool -- <source-path> ./docs
90+
```
91+
92+
Open `docs/index.html` to inspect the result locally.
93+
94+
## License
95+
96+
MIT — see [LICENSE](LICENSE).

readme.md

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)