This directory contains scripts used to generate the console output screenshots shown in the Console report format documentation.
These scripts allow reproducing the console output examples to:
- Regenerate screenshots when the addin is updated
- Test different console formatting options
- Validate console output behavior
generate-default.cake- Default console output settings with individual diagnosticsgenerate-grouped.cake- Console output grouped by rulegenerate-summaries.cake- Console output with provider and priority summariesgenerate-combined.cake- Console output with all features enabledsample-issues.json- Sample issues data used by all scriptsgenerate-screenshot.sh- Helper script to generate PNG screenshots from console outputrun-examples.sh- Script to generate all screenshots at once
Before running the scripts, ensure you have:
-
Built the NuGet packages (required for the scripts to work):
cd /path/to/Cake.Issues ./build.sh --target=Create-NuGet-Packages -
Required tools installed:
dotnet(for running Cake scripts)ansi2html(for converting ANSI terminal output to HTML)wkhtmltoimage(for converting HTML to PNG images)
Install the Python tools:
pip install ansi2html sudo apt install wkhtmltopdf # includes wkhtmltoimage
To regenerate all console output screenshots at once:
cd docs/input/assets/scripts/console-examples
./run-examples.shThis will generate all four PNG files in docs/input/assets/images/console-examples/:
console-default.pngconsole-grouped.pngconsole-summaries.pngconsole-combined.png
To generate a specific screenshot:
cd docs/input/assets/scripts/console-examples
./generate-screenshot.sh <script-name> <output-image-name>Examples:
./generate-screenshot.sh generate-default.cake console-default.png
./generate-screenshot.sh generate-grouped.cake console-grouped.png
./generate-screenshot.sh generate-summaries.cake console-summaries.png
./generate-screenshot.sh generate-combined.cake console-combined.pngTo just run the examples and see the console output without generating images:
cd docs/input/assets/scripts/console-examples
dotnet tool restore
dotnet tool run dotnet-cake generate-default.cake --settings_skippackageversioncheck=trueThe screenshot generation works as follows:
- Run Cake script - Execute the console report script and capture all output including ANSI color codes
- Convert ANSI to HTML - Use
ansi2htmlto convert terminal colors to HTML with CSS - Style HTML - Apply additional CSS styling for a clean terminal appearance
- Generate PNG - Use
wkhtmltoimageto convert the styled HTML to a PNG image - Save to docs - Place the generated PNG in the documentation assets directory
The sample-issues.json file contains realistic issue data representing:
- MSBuild compiler warnings and suggestions
- DupFinder duplicate code detection issues
- InspectCode style and best practice violations
- markdownlint documentation issues
- Custom script issues
Supporting files (src/ClassLibrary1/Class1.cs, docs/index.md, myfile.txt) are included to ensure the issues reference existing files, which is required for the console diagnostics to display properly.
The scripts demonstrate four distinct console output modes:
Shows individual diagnostics for each issue with detailed file context and syntax highlighting.
Groups issues with the same rule ID together, reducing redundancy and improving readability when multiple instances of the same issue exist.
Includes visual bar charts and detailed tables showing issue counts by provider and priority levels.
Demonstrates the most comprehensive output combining grouped diagnostics with summary tables.
This produces output similar to what users would see in real projects, helping them choose the right console report configuration for their needs.