Timeline Builder
Generate beautiful interactive timeline HTML pages from JSON configuration data, with three layout modes:
- Vertical layout (
vertical) — A classic top-to-bottom timeline with event cards alternating on either side of the axis
- Horizontal layout (
horizontal) — A horizontally scrollable timeline, best for displaying fewer events
- Dual-side layout (
dual-side) — Events are placed on the left or right based on the side field, great for side-by-side comparisons
All layouts support:
- Click to expand/collapse event details
- Mobile-friendly responsive design
- Custom theme colors, icons, and category labels
- Pure static HTML with zero dependencies — opens directly in any browser
Usage
Basic: Generate from a JSON config file
python3 scripts/generate_timeline.py --config timeline_data.json --output timeline.html
Read JSON from stdin
cat timeline_data.json | python3 scripts/generate_timeline.py --stdin --output timeline.html
Override layout mode (takes precedence over config file)
python3 scripts/generate_timeline.py --config data.json --layout horizontal --output timeline.html
JSON Configuration Format
{
"title": "Project Milestones",
"layout": "vertical",
"theme": {
"primaryColor": "#2563eb",
"secondaryColor": "#7c3aed",
"backgroundColor": "#ffffff",
"textColor": "#1f2937",
"lineColor": "#d1d5db",
"fontFamily": "system-ui, -apple-system, sans-serif"
},
"events": [
{
"date": "2024-01-15",
"title": "Project Kickoff",
"summary": "Approval completed, core team assembled",
"details": "Detailed description text, shown when the card is expanded...",
"icon": "🚀",
"category": "Milestone",
"color": "#10b981",
"side": "left"
}
]
}
CLI Arguments
| Argument |
Description |
--config, -c |
Path to the JSON config file (mutually exclusive with --stdin) |
--stdin |
Read JSON from standard input |
--output, -o |
Output HTML file path (defaults to stdout) |
--layout, -l |
Override layout mode: vertical, horizontal, dual-side |
--title, -t |
Override the timeline title |
Event Fields
| Field |
Required |
Description |
date |
Yes |
Date label — any format works (e.g. 2024-01, Q1 2024, Phase One) |
title |
Yes |
Event title |
summary |
No |
Short description, always visible on the card |
details |
No |
Detailed content, revealed on click |
icon |
No |
Emoji or single-character icon (defaults to ●) |
category |
No |
Category tag displayed on the card |
color |
No |
Event node color (overrides the theme color) |
side |
No |
Only for dual-side layout: left or right |
Use Cases
- Project milestone displays
- Product release histories
- Company growth timelines
- Personal resume timelines
- Course syllabus outlines
- Any scenario requiring chronological information display
Dependencies
- Python 3.6+ (standard library only — no extra packages required)
Activation Triggers
Triggered when a user mentions 'timeline', 'history of events', 'project milestones', 'release log', or asks to visualize a chronological sequence of data.
1---2name: timeline-builder3description: Generate beautiful interactive timeline HTML pages from JSON data, with vertical, horizontal, or dual-side layouts, collapsible details, and custom colors. Ideal for project milestones, company histories, or resumes.4license: MIT5---67# Timeline Builder89Generate beautiful interactive timeline HTML pages from JSON configuration data, with three layout modes:10111. **Vertical layout (`vertical`)** — A classic top-to-bottom timeline with event cards alternating on either side of the axis122. **Horizontal layout (`horizontal`)** — A horizontally scrollable timeline, best for displaying fewer events133. **Dual-side layout (`dual-side`)** — Events are placed on the left or right based on the `side` field, great for side-by-side comparisons1415All layouts support:16- Click to expand/collapse event details17- Mobile-friendly responsive design18- Custom theme colors, icons, and category labels19- Pure static HTML with zero dependencies — opens directly in any browser2021## Usage2223### Basic: Generate from a JSON config file2425```bash26python3 scripts/generate_timeline.py --config timeline_data.json --output timeline.html27```2829### Read JSON from stdin3031```bash32cat timeline_data.json | python3 scripts/generate_timeline.py --stdin --output timeline.html33```3435### Override layout mode (takes precedence over config file)3637```bash38python3 scripts/generate_timeline.py --config data.json --layout horizontal --output timeline.html39```4041### JSON Configuration Format4243```json44{45 "title": "Project Milestones",46 "layout": "vertical",47 "theme": {48 "primaryColor": "#2563eb",49 "secondaryColor": "#7c3aed",50 "backgroundColor": "#ffffff",51 "textColor": "#1f2937",52 "lineColor": "#d1d5db",53 "fontFamily": "system-ui, -apple-system, sans-serif"54 },55 "events": [56 {57 "date": "2024-01-15",58 "title": "Project Kickoff",59 "summary": "Approval completed, core team assembled",60 "details": "Detailed description text, shown when the card is expanded...",61 "icon": "🚀",62 "category": "Milestone",63 "color": "#10b981",64 "side": "left"65 }66 ]67}68```6970### CLI Arguments7172| Argument | Description |73|----------|-------------|74| `--config, -c` | Path to the JSON config file (mutually exclusive with `--stdin`) |75| `--stdin` | Read JSON from standard input |76| `--output, -o` | Output HTML file path (defaults to stdout) |77| `--layout, -l` | Override layout mode: `vertical`, `horizontal`, `dual-side` |78| `--title, -t` | Override the timeline title |7980### Event Fields8182| Field | Required | Description |83|-------|----------|-------------|84| `date` | Yes | Date label — any format works (e.g. `2024-01`, `Q1 2024`, `Phase One`) |85| `title` | Yes | Event title |86| `summary` | No | Short description, always visible on the card |87| `details` | No | Detailed content, revealed on click |88| `icon` | No | Emoji or single-character icon (defaults to `●`) |89| `category` | No | Category tag displayed on the card |90| `color` | No | Event node color (overrides the theme color) |91| `side` | No | Only for dual-side layout: `left` or `right` |9293## Use Cases9495- Project milestone displays96- Product release histories97- Company growth timelines98- Personal resume timelines99- Course syllabus outlines100- Any scenario requiring chronological information display101102## Dependencies103104- Python 3.6+ (standard library only — no extra packages required)105106## Activation Triggers107108Triggered when a user mentions 'timeline', 'history of events', 'project milestones', 'release log', or asks to visualize a chronological sequence of data.