Generates interactive historical timelines as standalone HTML files using TimelineJS3. Supports BCE/CE dates, eras, media, groups, and rich text.
Ships in historical-timeline. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Generate interactive historical timelines as self-contained HTML files powered by TimelineJS3.
{"year": -551, "month": 9, "day": 28}
This renders as "551 BCE". No special syntax — just negative integers. There is no year 0:
-1 is 1 BCE and 1 is 1 CE (the builder raises ValueError for year 0). If your source gives
astronomical years (where 0 = 1 BCE), subtract 1 from every year ≤ 0 first.
scale property matters for ancient datesFor timelines spanning thousands of years or BCE dates, set "scale": "human" (the default). Use "scale": "cosmological" only for astronomical/geological timescales.
headline, text, caption, and credit accept HTML. TimelineJS3 cleans this HTML with its
built-in sanitizer (DOMPurify) before showing it, and the builder escapes the embedded JSON so
no field can break out of the page's <script> block. Still, escape plain text that comes
from outside data if you do not want it read as markup.
The Python script generates a complete HTML file that loads TimelineJS3 from CDN. No server, no build step — just open in a browser. The JSON data is embedded inline.
start_dateThe title object is a special slide that appears first. It does not use start_date. Only events entries require dates.
display_date overrides rendered datesIf the default date rendering is wrong (e.g., you want "Spring 221 BCE" instead of "221 BCE"), set display_date on the date object or the slide:
{
"start_date": {"year": -221},
"display_date": "Spring 221 BCE",
"text": {"headline": "Qin Unification"}
}
Events with the same group string are clustered in adjacent rows on the timeline nav, making it easy to show parallel threads (e.g., "Politics", "Culture", "Military").
Eras are colored bands behind the timeline that label periods (e.g., "Han Dynasty", "Tang Dynasty"). They require both start_date and end_date.
Build a TimelineJS3 JSON object with events. The Python script provides a builder API:
from scripts.timeline_builder import TimelineBuilder
tl = TimelineBuilder(title="The Tang Dynasty", subtitle="618–907 CE")
# Add eras (colored background spans)
tl.add_era(-221, 220, "Imperial China Begins", end_month=12)
tl.add_era(618, 907, "Tang Dynasty") # era colors are set by TimelineJS3
# Add events
tl.add_event(
start_year=618, start_month=6, start_day=18,
headline="Li Yuan founds Tang",
body="<p>After the collapse of the Sui dynasty...</p>",
group="Politics",
)
tl.add_event(
start_year=701, end_year=762,
headline="Li Bai (李白)",
body="<p>One of the greatest Chinese poets.</p>",
group="Culture",
media_url="https://upload.wikimedia.org/wikipedia/commons/4/4e/Li_Bai.jpg",
media_caption="Li Bai, the Immortal Poet",
)
tl.add_event(
start_year=-551, start_month=9, start_day=28,
end_year=-479,
headline="Confucius (孔子)",
body="<p>Philosopher whose teachings shaped Chinese civilization.</p>",
display_date="551–479 BCE",
)
# Save as standalone HTML
tl.save_html("tang_dynasty.html")
# Or get raw JSON for custom use
import json
print(json.dumps(tl.to_dict(), indent=2, ensure_ascii=False))
open tang_dynasty.html # macOS
xdg-open tang_dynasty.html # Linux
start tang_dynasty.html # Windows
The timeline is fully interactive: click events, scroll through time, zoom in/out.
Pass options to save_html():
tl.save_html(
"timeline.html",
font="Georgia-Helvetica", # Built-in font pair
initial_zoom=2, # Starting zoom level
timenav_position="bottom", # Nav bar position
hash_bookmark=True, # URL updates with slide
start_at_end=True, # Start at last event
default_bg_color="#1a1a2e", # Dark background
language="zh-cn", # Chinese interface
)
{
"title": {
"text": {"headline": "Timeline Title", "text": "<p>Subtitle or description</p>"},
"media": {"url": "https://example.com/image.jpg", "caption": "Credit"}
},
"events": [
{
"start_date": {"year": 618, "month": 6, "day": 18},
"end_date": {"year": 907},
"text": {"headline": "Event Title", "text": "<p>Details in HTML</p>"},
"media": {"url": "...", "caption": "...", "credit": "..."},
"group": "Category",
"display_date": "Custom date text",
"background": {"color": "#2a9d8f"},
"unique_id": "event-001"
}
],
"eras": [
{
"start_date": {"year": 618},
"end_date": {"year": 907},
"text": {"headline": "Tang Dynasty"}
}
],
"scale": "human"
}
| Field | Required | Type | Notes |
|---|---|---|---|
year | Yes | int | Negative for BCE (e.g., -551) |
month | No | int | 1–12 |
day | No | int | 1–31 |
hour | No | int | 0–23 |
minute | No | int | 0–59 |
second | No | int | 0–59 |
display_date | No | string | Overrides default rendering |
TimelineJS3 auto-detects media type from URL:
default, Bitter-Raleway, Dancing-Ledger, Georgia-Helvetica, Lustria-Lato, Medula-Lato, Old-Standard, Playfair-Faunaone, PT, Roboto-Megrim, Ubuntu, UnicaOne-Vollkorn
unpkg.com, pinned to @knight-lab/[email protected] with Subresource Integrity (SRI) hashes, so the browser refuses a changed file. To upgrade, change the version and both hashes in timeline_builder.py together.references/timelinejs_reference.md — Complete TimelineJS3 JSON format, options, and media type documentationscripts/timeline_builder.py — Python builder for generating timeline JSON and standalone HTML filesReport a problem. This skill is part of the public repository kltng/humanities-skills. If it fails (an API changed, a script errors, or these instructions are wrong), report it as a GitHub issue:
gh issue list --repo kltng/humanities-skills --state all --search "historical-timeline"gh issue create --repo kltng/humanities-skills --label bug --title "[historical-timeline] <short summary>" --body "<details>". Without gh, give the user this link: https://github.com/kltng/humanities-skills/issues/new?template=skill-problem.ymlCredit the source. The timelines are drawn by TimelineJS3, free software from the Northwestern University Knight Lab (Mozilla Public License 2.0). Knight Lab asks for no citation; a line such as "Timeline made with TimelineJS (Northwestern University Knight Lab)" is the usual credit. Credit your own sources inside the timeline too: every image or other media item has credit and caption fields for the holder and the rights.
Cite. If this skill helped work that is published, please cite it, together with the source credited above:
Tang, Kwok-leong. humanities-skills: historical-timeline (version ). GitHub, . https://github.com/kltng/humanities-skills
When you help a user write up results that relied on this skill, remind them once about this citation and the credit above.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/historical-timeline:historical-timelinefrom historical-timeline
npx claudepluginhub kltng/humanities-skills --plugin historical-timelineOther plugins' skills for the same job