Syntax highlighting and code snippets for Bardic interactive fiction files (.bard).
Download on the VS Code Marketplace.
- Syntax Highlighting for all Bardic constructs:
- Passage headers with tags
- Variables and expressions
- Choices (regular and conditional)
- Control flow (
@if,@for, etc.) - Python code blocks with full Python syntax
- Comments (full-line
#and inline//) - Directives (
@include,@render,@input,@state,@metadata) - And more!
Visualize your entire story structure as an interactive graph:
Features:
- Color-coded connections: Regular choices (purple), conditional choices (orange), jumps (gold)
- Bug detection: Missing passages highlighted in red, orphaned passages in cyan
- Click to navigate: Click any node to jump to that passage in your code
- Export: Save your graph as PNG or SVG
- Stats: See passage count, choices, and potential issues at a glance
- Auto-refresh: Graph updates when you save your file
To use: Open any .bard file and click the graph icon in the editor toolbar, or run "Bardic: Show Story Graph" from the command palette.
Pre-test an individual passage's final rendering with injectable game state variables.
- You can navigate through the game like this, including selecting choices.
- Shows active inserted game state values.
- Allows you to Reset to the start of the story.
To use: Position your cursor inside any passage and open the Command Palette. Type "Bardic live preview". It will also allow you inject any game state values as a JSON prior to rendering.
- Code Snippets for rapid development:
if- Simple if blockifel- If-else block (no elif)iff- Full if/elif/else blockfor- For loopchoice- Regular choicecchoice- Conditional choicepassage- Passage headerbr- Section divider with dashesbigbr- Major section divider with equals signsmetadata- Metadata blockstart- Start directive
Simply open any .bard file and enjoy beautiful syntax highlighting!
Type snippet triggers and press Tab to insert code templates with smart tab stops.
Bardic is a Python-first interactive fiction engine for modern web applications.
Enjoy writing interactive fiction! 🦝✨

