Timeline DSL — VS Code ExtensionSyntax highlighting and language intelligence for Timeline DSL ( Timeline DSL is a domain-specific language for building historical timelines with Wikidata integration.
FeaturesSyntax Highlighting
Language Server (LSP) — requires
|
| Setting | Default | Description |
|---|---|---|
timelineDsl.serverPath |
"" |
Path to the tdsl binary. If empty, the binary is resolved from PATH. |
timelineDsl.trace.server |
"off" |
Trace LSP communication (off / messages / verbose). Use this when filing a bug report. |
Commands — requires tdsl binary
| Command | Description |
|---|---|
Timeline DSL: Open Preview to the Side |
Render the current .tdsl file with tdsl render --format svg and show it in a Webview beside the editor. The preview refreshes on save. |
Timeline DSL: Restart Language Server |
Restart the language server without reloading the window. |
The preview runs tdsl render once per refresh rather than keeping tdsl render --watch alive: a long-lived child process would have to be torn down on every window close, workspace switch, and extension reload, and a missed teardown leaves the process running.
The preview requires a saved file (the CLI takes a path). Scripts are disabled in the Webview (default-src 'none'); interactive features live in the WebUI.
Example
// Chinese Dynasties Timeline
timeline "Chinese Dynasties" {
unit year;
range -500..2000;
calendar proleptic_gregorian;
}
lane "Qin" as qin { kind dynasty; order 10; }
lane "Han" as han { kind dynasty; order 20; }
span qin -221..-206 "Qin Dynasty" { source wd:Q7183; };
span han -206..220 "Han Dynasty" { source wd:Q7209; };
event qin -221 "Unification of China" {};
// Import from Wikidata
import wikidata as wd {
entity Q7209 as han_entity;
}
map wd.han_entity to span {
lane han;
label label@en;
start claim(P571).year;
end claim(P576).year;
}
Usage
Install the Timeline DSL CLI to compile .tdsl files:
# Build to JSON IR
tdsl build my_timeline.tdsl --pretty
# Render to HTML/SVG
tdsl render my_timeline.tdsl -o output.html
# Check for errors
tdsl check my_timeline.tdsl
Links
License
MIT © keroway