Purpose: Static HTML website generation from pipeline artifacts and results
Pipeline Step: Step 20: Website generation (20_website.py)
Category: Documentation / Website Generation
Status: ✅ Production Ready
Version: 1.0.0
Last Updated: 2026-01-21
- Generate static HTML websites from pipeline results
- Create interactive documentation and reports
- Organize and present pipeline artifacts
- Generate cross-linked documentation
- Create publication-ready websites
- Static website generation from pipeline artifacts
- Interactive documentation and reports
- Cross-linked content organization
- Publication-ready HTML output
- Asset management and optimization
process_website(target_dir: Path, output_dir: Path, verbose: bool = False, logger: Optional[logging.Logger] = None, **kwargs) -> bool
Description: Main website generation function called by orchestrator (20_website.py). Generates static HTML website from pipeline artifacts.
Parameters:
target_dir(Path): Directory containing pipeline artifactsoutput_dir(Path): Output directory for website filesverbose(bool): Enable verbose logging (default: False)logger(Optional[logging.Logger]): Logger instance (default: None)website_html_filename(str, optional): Output HTML filename (default: "gnn_pipeline_summary_website.html")include_visualizations(bool, optional): Include visualization pages (default: True)include_reports(bool, optional): Include report pages (default: True)include_analysis(bool, optional): Include analysis pages (default: True)**kwargs: Additional website generation options
Returns: bool - True if website generation succeeded, False otherwise
Example:
from website import process_website
from pathlib import Path
import logging
logger = logging.getLogger(__name__)
success = process_website(
target_dir=Path("output"),
output_dir=Path("output/20_website_output"),
logger=logger,
verbose=True,
website_html_filename="custom_summary.html"
)Description: Generate HTML report from content (markdown or structured data).
Parameters:
content(Union[str, Dict[str, Any]]): Content to convert to HTML (markdown string or structured dict)title(str): Report title (default: "Report")
Returns: str - HTML string with formatted report
Description: Embed image in HTML output file.
Parameters:
image_path(Path): Path to image fileoutput_file(Path): Output HTML file to embed image inalt_text(str): Alternative text for image (default: "")
Returns: bool - True if embedding succeeded, False otherwise
Returns: True if embedding succeeded
Description: Embed markdown file in HTML output
Parameters:
md_path: Path to markdown fileoutput_file: Output HTML file
Returns: True if embedding succeeded
pathlib- Path manipulationjinja2- HTML templating
markdown- Markdown to HTML conversionbleach- HTML sanitization
utils.pipeline_template- Pipeline utilities
WEBSITE_CONFIG = {
'template': 'default',
'theme': 'modern',
'include_navigation': True,
'generate_sitemap': True,
'optimize_assets': True
}CONTENT_CONFIG = {
'include_pipeline_summary': True,
'include_visualizations': True,
'include_reports': True,
'include_raw_data': False
}from website import process_website
success = process_website(
target_dir="output/",
output_dir="output/20_website_output"
)from website import generate_html_report
html_content = generate_html_report(markdown_content)
with open("report.html", "w") as f:
f.write(html_content)from website import embed_image
success = embed_image(
image_path="visualizations/network.png",
output_file="website/index.html"
)index.html- Main website page*.html- Individual report pagesassets/- Static assets and resourcessitemap.xml- Website sitemapwebsite_summary.json- Website generation summary
output/20_website_output/
├── index.html
├── pipeline_summary.html
├── visualizations.html
├── reports.html
├── assets/
│ ├── css/
│ ├── js/
│ └── images/
└── website_summary.json
- Duration: ~2-5 seconds
- Memory: ~50-100MB
- Status: ✅ Production Ready
- Basic Generation: 1-2 seconds
- Full Website: 3-5 seconds
- Asset Optimization: 1-3 seconds
- Content Processing: 2-4 seconds
- Template Errors: Template rendering failures
- Content Errors: Content processing failures
- Asset Errors: Asset embedding failures
- File I/O: File system operation failures
- Template Recovery: Use default templates
- Content Simplification: Simplify content processing
- Asset Skip: Skip problematic assets
- Error Documentation: Generate error reports
- Script:
20_website.py(Step 20) - Function:
process_website()
utils.pipeline_template- Pipeline utilities
main.py- Pipeline orchestrationtests.test_website_*- Website tests
Pipeline Artifacts → Content Extraction → Template Processing → Asset Embedding → Website Generation
src/tests/test_website_overall.py- Module-level tests
- Current: 79%
- Target: 85%+
- Website generation from pipeline artifacts
- HTML report creation and formatting
- Asset embedding and management
- Error handling and recovery
website.generate- Generate website from artifactswebsite.create_report- Create HTML reportswebsite.embed_assets- Embed assets in HTMLwebsite.validate_content- Validate website content
@mcp_tool("website.generate")
def generate_website_tool(artifacts_dir, output_dir):
"""Generate website from pipeline artifacts"""
# Implementationsrc/website/mcp.py- MCP tool registrations
Symptom: HTML files not generated or incomplete
Cause: Missing pipeline artifacts or template issues
Solution:
- Verify previous pipeline steps completed successfully
- Check that required artifacts exist in output directories
- Use
--verboseflag for detailed generation logs - Review website template structure
Symptom: Website generated but images or markdown not embedded
Cause: File paths incorrect or files missing
Solution:
- Verify all referenced files exist
- Check file paths are relative to website output directory
- Ensure images and markdown files are accessible
- Review embedding function logs
Features:
- Static HTML website generation
- Interactive documentation
- Cross-linked content
- Asset management
Known Issues:
- None currently
- Next Version: Enhanced interactivity
- Future: Dynamic content generation
Last Updated: 2026-01-21 Maintainer: GNN Pipeline Team Status: ✅ Production Ready Version: 1.0.0 Architecture Compliance: ✅ 100% Thin Orchestrator Pattern