Skip to content

feat: Add support for custom guidance and appendices in HTML reports #467

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

leonamagaya
Copy link

@leonamagaya leonamagaya commented Aug 20, 2025

What does this PR do?

This PR adds support for customizable guidance and appendices content in Cloudsplaining HTML reports. Users can now provide their own HTML content files to customize the guidance and appendices sections of their reports.

Key features:

  • Custom content files: Users can create custom-guidance.html and custom-appendices.html files in their working directory
  • Automatic detection: The system automatically detects and loads custom content files when present
  • Fallback behavior: Falls back to default content when custom files don't exist
  • Navigation control: Empty custom files hide the corresponding navigation sections entirely
  • Security: Proper HTML escaping prevents JavaScript injection vulnerabilities
  • Flexible usage: Supports mixed scenarios (one custom file, one default)

What gif best describes this PR or how it makes you feel?

image

Completion checklist

  • Additions and changes have unit tests
  • The pull request has been appropriately labeled using the provided PR labels
  • GitHub actions automation is passing (make test, make lint, make security-test, make test-js)
  • If the UI contents or JavaScript files have been modified, generate a new example report:

- Add TemplateConfig class to detect and process custom HTML content files
- Support custom-guidance.html and custom-appendices.html files in working directory
- Implement proper HTML escaping for JavaScript injection safety
- Add navigation visibility controls based on content availability
- Empty custom files hide corresponding navigation sections
- Fall back to default content when custom files don't exist
- Include comprehensive test coverage for all scenarios
@leonamagaya leonamagaya changed the title Feature/custom guidance appendices feat: Add support for custom guidance and appendices in HTML reports Aug 20, 2025
@leonamagaya leonamagaya marked this pull request as ready for review August 20, 2025 10:28
@kmcquade kmcquade requested a review from Copilot August 20, 2025 11:11
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for custom guidance and appendices content in Cloudsplaining HTML reports by allowing users to provide custom HTML files that override default content sections.

  • Adds TemplateConfig class to detect and process custom HTML files (custom-guidance.html and custom-appendices.html)
  • Implements conditional navigation visibility based on content availability
  • Integrates custom content rendering in Vue.js components with proper HTML escaping

Reviewed Changes

Copilot reviewed 8 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/shared/test_template_config.py Comprehensive test suite covering all template configuration scenarios
cloudsplaining/shared/template_config.py Core logic for detecting, loading, and processing custom content files
cloudsplaining/output/template.html JavaScript variable definitions for template configuration
cloudsplaining/output/src/views/Guidance.vue Vue component updated to render custom or default guidance content
cloudsplaining/output/src/views/Appendices.vue Vue component updated to render custom or default appendices content
cloudsplaining/output/src/routes/routes.js Dynamic route registration based on navigation visibility flags
cloudsplaining/output/src/App.vue Navigation menu updates with conditional visibility and code formatting
cloudsplaining/output/report.py Integration of TemplateConfig into the report generation process

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

leonamagaya and others added 3 commits August 20, 2025 14:41
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant