Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
84 changes: 84 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Generate and Deploy Documentation

on:
push:
branches: [ main ]
paths:
- 'docs-config.json'
- 'scripts/Generate-Docs.ps1'
- '.github/workflows/docs.yml'
schedule:
# Run weekly to pick up new package versions
- cron: '0 2 * * 0'
workflow_dispatch:
inputs:
force_rebuild:
description: 'Force complete rebuild'
required: false
default: 'false'
type: boolean

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
generate-docs:
runs-on: windows-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'

- name: Setup NuGet
uses: NuGet/setup-nuget@v2

- name: Install DocFX
run: dotnet tool install -g docfx

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('docs-config.json') }}
restore-keys: |
${{ runner.os }}-nuget-

- name: Generate Documentation
shell: pwsh
run: |
$cleanFlag = if ("${{ github.event.inputs.force_rebuild }}" -eq "true") { "-Clean" } else { "" }
& "./scripts/Generate-Docs.ps1" -ConfigFile "docs-config.json" -OutputPath "docs" $cleanFlag

- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/_site

deploy:
needs: generate-docs
runs-on: ubuntu-latest

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,10 @@ Microsoft.VisualStudio.Glass
/Iris/Programs/*.pdb
/Iris/ic/Properties/launchSettings.json
/Iris/xplat-package/Properties/launchSettings.json

# DocFX
docs/_site/
docs/api/
docs/docfx.json
docs/filterConfig.yml
*.tmp
204 changes: 204 additions & 0 deletions DOCFX_USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
# DocFX Documentation Generation System

This repository contains a complete solution for generating and hosting API documentation from NuGet packages using DocFX.

## 🚀 Quick Start

### Prerequisites
- PowerShell 5.1 or later
- .NET SDK 8.0 or later
- NuGet CLI (optional, for package version updates)
- DocFX (installed automatically by scripts)

### Generate Documentation Locally

```powershell
# Option 1: Generate and serve locally in one command
.\scripts\Serve-Docs-Local.ps1

# Option 2: Generate only
.\scripts\Generate-Docs.ps1 -ConfigFile docs-config.json -OutputPath docs

# Option 3: Generate with clean rebuild
.\scripts\Generate-Docs.ps1 -ConfigFile docs-config.json -OutputPath docs -Clean
```

After running, the documentation will be available at: `http://localhost:8080`

## 📦 Configuration

Edit `docs-config.json` to configure which NuGet packages to document:

```json
{
"packages": [
{
"id": "Microsoft.VisualStudio.Debugger.Engine",
"version": "17.14.1051801",
"description": "Visual Studio Debugger Engine APIs and interfaces",
"framework": "net472"
}
],
"docfx": {
"siteName": "Visual Studio Debugger Engine Documentation",
"siteDescription": "API documentation for Visual Studio Debugger Engine extensibility interfaces",
"baseUrl": "https://microsoft.github.io/ConcordExtensibilitySamples/"
}
}
```

### Package Configuration Options
- **id**: NuGet package ID
- **version**: Specific version to document
- **description**: Human-readable description for the documentation
- **framework**: Target framework (e.g., "net472", "netstandard2.0")

## 🔄 Automatic Updates

### GitHub Actions
The repository includes a GitHub Action (`.github/workflows/docs.yml`) that:
- Runs automatically on pushes to main branch
- Runs weekly to pick up new package versions
- Can be triggered manually with force rebuild option
- Deploys to GitHub Pages automatically

### Package Version Updates
```powershell
# Check for updates (preview mode)
.\scripts\Update-PackageVersions.ps1 -Preview

# Update configuration file with latest versions
.\scripts\Update-PackageVersions.ps1
```

## 📁 Generated Structure

```
docs/
├── _site/ # Generated static website
├── api/ # Generated API reference (YAML files)
├── docfx.json # DocFX configuration (auto-generated)
├── index.md # Documentation homepage
└── toc.yml # Table of contents
```

## 🌐 GitHub Pages Deployment

The documentation is automatically deployed to GitHub Pages at:
**https://microsoft.github.io/ConcordExtensibilitySamples/**

### Manual Deployment Setup
1. Go to repository Settings > Pages
2. Set Source to "GitHub Actions"
3. The workflow will handle the rest automatically

## 🛠️ Troubleshooting

### Common Issues

1. **DocFX not found**
```powershell
dotnet tool install -g docfx
```

2. **NuGet package download fails**
- Check package ID and version in `docs-config.json`
- Ensure internet connectivity
- Verify package exists on nuget.org

3. **Documentation generation fails**
- Check that assemblies were extracted successfully
- Verify .NET target framework compatibility
- Review DocFX logs for specific errors

4. **GitHub Actions fails**
- Check workflow permissions (Pages deployment requires write permissions)
- Verify repository has GitHub Pages enabled
- Review action logs for specific errors

### Debug Mode
Run scripts with verbose output:
```powershell
$VerbosePreference = "Continue"
.\scripts\Generate-Docs.ps1 -ConfigFile docs-config.json -Verbose
```

## 📋 Script Reference

### Generate-Docs.ps1
Main documentation generation script.

**Parameters:**
- `-ConfigFile`: Path to configuration JSON file (required)
- `-OutputPath`: Output directory for generated docs (default: "docs")
- `-Clean`: Remove existing files before generation

### Update-PackageVersions.ps1
Updates package versions in configuration to latest available.

**Parameters:**
- `-ConfigFile`: Path to configuration JSON file (default: "docs-config.json")
- `-Preview`: Show available updates without applying them

### Serve-Docs-Local.ps1
Generates and serves documentation locally for development.

**Parameters:**
- `-ConfigFile`: Path to configuration JSON file (default: "docs-config.json")
- `-Port`: Port for local web server (default: 8080)

## 🔧 Advanced Configuration

### Custom DocFX Templates
Modify the `template` array in the generated `docfx.json` to use custom templates:

```json
{
"build": {
"template": ["default", "modern", "custom-template-path"]
}
}
```

### Multiple Package Sources
Add multiple packages to document different APIs:

```json
{
"packages": [
{
"id": "Microsoft.VisualStudio.Debugger.Engine",
"version": "17.14.1051801",
"description": "Visual Studio Debugger Engine APIs",
"framework": "net472"
},
{
"id": "Microsoft.VisualStudio.Shell.Framework",
"version": "17.0.31902.203",
"description": "Visual Studio Shell Framework",
"framework": "net472"
}
]
}
```

### Custom Metadata
Add custom metadata to generated documentation:

```json
{
"docfx": {
"siteName": "My API Docs",
"siteDescription": "Documentation for my APIs",
"baseUrl": "https://myorg.github.io/myrepo/",
"customMetadata": {
"_appFooter": "Copyright © 2025 My Organization",
"_appLogoPath": "images/logo.png"
}
}
}
```

## 📝 License

This documentation system is part of the ConcordExtensibilitySamples repository and follows the same licensing terms.
32 changes: 30 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
## ConcordExtensibilitySamples
# ConcordExtensibilitySamples

Visual Studio Debug Engine Extensibility Samples

## Documentation

📚 **[View API Documentation](https://microsoft.github.io/ConcordExtensibilitySamples/)** - Complete API documentation for Visual Studio Debugger Engine extensibility interfaces

### What are "Concord Extensibility Samples"?
[Concord](https://github.com/Microsoft/ConcordExtensibilitySamples/wiki/Overview) is the code name for Visual Studio's new debug engine that first shipped in Visual Studio 2012. Concord was designed to be extensible and this repo contains samples of these extensions.
[Concord](https://github.com/Microsoft/ConcordExtensibilitySamples/wiki/Overview) is the code name for Visual Studio's new debug engine that first shipped in Visual Studio 2012. Concord was designed to be extensible and this repo contains samples of these extensions.

The samples in this repo currently target Visual Studio 2022 (version 17.0). For older versions of these samples, please see the [VS16 branch](https://github.com/Microsoft/ConcordExtensibilitySamples/tree/VS16).

Expand All @@ -17,4 +22,27 @@ If you want to dive right into some code for extending the debug engine, take a
* [Managed Expression Evaluator](https://github.com/Microsoft/ConcordExtensibilitySamples/wiki/Managed-Expression-Evaluator-Sample)
* [C++ Custom Visualizer](https://github.com/Microsoft/ConcordExtensibilitySamples/wiki/Cpp-Custom-Visualizer-Sample)

## Documentation Generation

This repository automatically generates and hosts API documentation for Visual Studio extensibility interfaces using DocFX. The documentation is built from NuGet packages and deployed to GitHub Pages.

### Local Development

To generate and serve documentation locally:

```powershell
# Generate and serve docs locally
.\scripts\Serve-Docs-Local.ps1

# Update package versions
.\scripts\Update-PackageVersions.ps1

# Generate docs only
.\scripts\Generate-Docs.ps1 -ConfigFile docs-config.json
```

### Configuration

Edit [`docs-config.json`](docs-config.json) to configure which NuGet packages to document.

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
15 changes: 15 additions & 0 deletions docs-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"packages": [
{
"id": "Microsoft.VisualStudio.Debugger.Engine",
"version": "17.14.1051801",
"description": "Visual Studio Debugger Engine APIs and interfaces",
"framework": "netstandard2.0"
}
],
"docfx": {
"siteName": "Visual Studio Debugger Engine Documentation",
"siteDescription": "API documentation for Visual Studio Debugger Engine extensibility interfaces",
"baseUrl": "https://microsoft.github.io/ConcordExtensibilitySamples/"
}
}
18 changes: 18 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Visual Studio Debugger Engine Documentation

API documentation for Visual Studio Debugger Engine extensibility interfaces

## API Documentation

This documentation covers the following packages:

- **Microsoft.VisualStudio.Debugger.Engine** v17.14.1051801 - Visual Studio Debugger Engine APIs and interfaces


## API Reference

Browse the [API Reference](api/) for detailed documentation of all types and members.

---

*Generated on 2025-07-21 23:25:11 UTC from NuGet packages*
4 changes: 4 additions & 0 deletions docs/toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- name: Home
href: index.md
- name: API Reference
href: api/
Loading
Loading