VS Code extension that adds syntax highlighting and editing support for .deck flashcard files used by the
HexyCards project.
This extension provides a development experience for
HexyCards .deck files:
- Syntax highlighting for:
- metadata (
@title,@lang,@author) - comments
- questions
- answers
- multiple choice answers
- metadata (
- Visual differentiation between:
- correct answers
- wrong answers
- Detection of incomplete flashcards
- Hover explanations for deck elements
When the extension activates for the first time, a popup will appear asking:
Do you want to apply the recommended HexyCards colors?
It is strongly recommended to click Yes.
This will apply the color configuration required for the full HexyCards editing experience.
✔ The configuration only affects the custom scopes used by .deck
files
✔ It does not modify the appearance of other languages
Other file types like .js, .php, .py, .json, etc. remain
unchanged.
The extension highlights .deck files using the following logic:
Element Color
Metadata (@title, @lang, @author) Orange
Metadata value Gray
Comments Cyan
Question Green
:: separator Gray
Correct answer Light pastel green
Wrong answers Light pastel red
Incomplete card Red
If you want to customize the colors, you can modify your VS Code settings.
Open:
Preferences → Open Settings (JSON)
Then edit the section:
editor.tokenColorCustomizationsExample:
{
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "entity.name.question.deck",
"settings": {
"foreground": "#6CE36C"
}
}
]
}
}All HexyCards scopes end with .deck, so they only affect .deck
files.
To build the extension locally:
npm install -g @vscode/vsce
Inside the project folder run:
vsce package
This will generate a file like:
hexycards-deck-0.0.x.vsix
In VS Code:
Ctrl + Shift + P
Run:
Extensions: Install from VSIX
Then select the generated .vsix file.