A Python-based generator that creates a fully static API documentation portal from OpenAPI 3.0 specifications and skills.
✅ 100% Static - No backend server, no build tools, no runtime needed
✅ Offline Ready - Just double-click portal/index.html to open
✅ Modern UI - Responsive design with dark mode support
✅ Skills Integration - Prominently displays workflows and JTBDs
✅ Fast - Generates entire portal in ~5 seconds
✅ Easy Deploy - Copy to GitHub Pages, Netlify, S3, or any static host
# Using Make
make generate-portal
# Or directly with Python
python3 scripts/generate_portal.py --output portalJust open the file! No server needed:
# macOS
open portal/index.html
# Windows
start portal/index.html
# Linux
xdg-open portal/index.htmlportal/
├── index.html # Homepage with API catalog
├── apis/
│ ├── api-manager.html # 31 individual API pages
│ ├── access-management.html
│ └── ...
├── assets/
│ ├── styles.css # ~14KB CSS
│ └── portal.js # ~2.4KB JavaScript
- Statistics Bar: API count, endpoint count, skills count
- Category Filtering: Filter APIs by category (API Management, Runtime, Security, etc.)
- API Cards: Name, version, description, endpoint count, skills badge
- Skills Section: List of all 8 skills with descriptions
- API Header: Title, version, description, base URL, operation count
- Skills Section: Expandable skill cards with step-by-step workflows
- Operations List: All operations with method badges, paths, descriptions
- Search: Client-side filtering of operations
- Back Navigation: Return to homepage
- ✅ Filter APIs by category (no page reload)
- ✅ Search operations by keyword
- ✅ Expandable skill workflows
- ✅ Smooth scrolling to sections
- ✅ Responsive design (mobile, tablet, desktop)
- ✅ Dark mode (automatic based on system preference)
- Scans all API directories for
api.yamlfiles - Parses OpenAPI 3.0 specifications
- Discovers skills in the top-level
skills/*/SKILL.mddirectory - Calculates statistics
- Renders homepage with all APIs and skills
- Generates individual detail page for each API
- Creates CSS with modern styling
- Creates JavaScript for interactivity
- Writes all HTML files to
portal/ - Includes inline CSS and JavaScript
- Works offline via
file://protocol
ruamel.yaml>=0.17.0 # Streaming YAML parser
python-frontmatter>=1.0 # Parse skill frontmatterInstall with:
pip install ruamel.yaml python-frontmatterThe generator automatically:
- Discovers all APIs in the repository
- Categorizes APIs based on name mapping
- Parses skills from
skills/*/SKILL.md - Generates responsive, modern UI
APIs are auto-categorized:
| Category | APIs |
|---|---|
| API Management | api-manager, api-platform |
| Runtime | cloudhub, cloudhub-20, runtime-fabric |
| Security | secrets-manager, anypoint-security-policies, tokenization-* |
| Monitoring | metrics, arm-monitoring-query, anypoint-monitoring-archive |
| Access & Identity | access-management |
| Gateway | flex-gateway-manager, proxies-xapi |
| Messaging | anypoint-mq-* |
| Storage | object-store-v2* |
| And more... | See CATEGORY_MAPPING in script |
python3 scripts/generate_portal.py [OPTIONS]
Options:
--output, -o Output directory (default: portal)
--repo, -r Repository root (default: current directory)# Generate portal
make generate-portal
# Create gh-pages branch
cd portal
git init
git add -A
git commit -m "Deploy API portal"
git push -f git@github.com:your-org/your-repo.git main:gh-pages- Connect your repository
- Set build command:
make generate-portal - Set publish directory:
portal - Deploy!
# Generate portal
make generate-portal
# Sync to S3
aws s3 sync ./portal s3://your-bucket-name --delete
# Optional: Invalidate CloudFront
aws cloudfront create-invalidation --distribution-id YOUR_ID --paths "/*"# Generate portal
make generate-portal
# Create zip
cd portal
zip -r ../api-portal.zip .
cd ..
# Send api-portal.zip to anyone - they just unzip and open index.html!| Component | Size | Notes |
|---|---|---|
| index.html | ~30KB | Homepage with all APIs |
| styles.css | ~14KB | Modern CSS (~4KB gzipped) |
| portal.js | ~2.4KB | Minimal JavaScript (~1KB gzipped) |
| API pages | Varies | 3KB (metrics) to 155KB (access-management) |
| Total | ~1.2MB | All 31 APIs + assets |
- Generation Time: ~5 seconds for all 31 APIs
- Page Load Time: <500ms for homepage (file://)
- Detail Page Load: <1s even for largest API (access-management, 267 ops)
- Filtering: Instant (client-side JavaScript)
- Search: Instant (client-side JavaScript)
Works in all modern browsers:
- ✅ Chrome/Edge (latest)
- ✅ Firefox (latest)
- ✅ Safari (latest)
- ✅ Mobile browsers (iOS Safari, Chrome Android)
- Make sure you're opening
portal/index.html(notindex.htmlfrom root) - Try a different browser
- Check browser console for errors (F12)
- Verify skills exist in
skills/*/SKILL.md - Regenerate portal:
make generate-portal - Check skill frontmatter format (name, description fields)
- JavaScript may be disabled in browser
- Check browser console for errors
- Portal works without JS (just no filtering)
- Check that API has valid
api.yamlfile - Verify OpenAPI 3.0 format
- Regenerate portal:
make generate-portal
scripts/
└── generate_portal.py # Main generator script
├── OAS Parser # Parse api.yaml files
├── Skill Parser # Parse SKILL.md files
├── Homepage Generator # Build index.html
├── Detail Page Generator # Build API pages
├── CSS Generator # Create styles.css
└── JS Generator # Create portal.js
To add a new section:
- Create a render method in
PortalGeneratorclass - Call it from
generate_homepage()orgenerate_api_page() - Add corresponding CSS styles in
generate_css()
To modify styling:
- Edit CSS in
generate_css()method - Use CSS variables for colors/spacing
- Regenerate:
make generate-portal
To add interactivity:
- Add JavaScript in
generate_js()method - Set up event listeners in
DOMContentLoaded - Regenerate:
make generate-portal
- Open
portal/index.html - Click category button (e.g., "Security")
- Only APIs in that category are shown
- Open any API detail page (e.g.,
portal/apis/api-manager.html) - Type in search box (e.g., "policy")
- Operations matching query are shown
- Open
portal/apis/api-manager.html - Scroll to "Skills & Workflows" section
- Click "View Workflow Steps" on any skill card
- Steps expand inline
Potential additions (not in current version):
- Full-text search across all APIs and operations
- Interactive "Try It Out" console with OAuth2
- Export to Postman/Insomnia collections
- API changelog/diff viewer
- Skill execution wizard
- Analytics tracking
For issues or questions:
- Check this README
- Review generator output for errors
- Inspect browser console (F12)
- Regenerate portal:
make generate-portal
Part of the api-notebook-anypoint-specs repository.
Status: ✅ Production Ready Version: 1.0 Last Updated: 2026-03-26