This project uses a TypeScript-based build system to generate Notepad++ theme XML files from structured theme definitions.
- Install dependencies:
npm installTo generate all theme XML files from the theme definitions:
npm run buildor
npm run buildThis will:
- Use the TypeScript template (
themes/template.ts) which defines all lexer structures - Apply color palettes from theme definitions (
themes/dracula.ts,themes/alucard.ts) - Generate XML files in the
generated/folder
Note: Only colors are applied - fonts and font sizes are not included in the generated files as per design requirements.
Theme colors are defined in TypeScript files under themes/:
themes/dracula.ts- Dracula dark themethemes/alucard.ts- Alucard light theme
Each theme defines a color palette with semantic names like foreground, background, keyword, string, etc.
The generator:
- Parses
Dracula.xmlto extract the structure (all lexers and their styles) - Creates a mapping from hex colors in the source XML to semantic color keys
- Applies each theme's color palette to generate new XML files
- Create a new file in
themes/(e.g.,themes/my-theme.ts) - Export a theme definition following the same structure as
dracula.ts - Add it to the themes array in
scripts/generate-themes.ts - Run
npm run build
To change colors in a theme:
- Edit the theme file in
themes/(e.g.,themes/dracula.ts) - Update the hex color values in the
colorsobject - Run
npm run buildto regenerate the XML files
If Notepad++ adds new language lexers or styles:
- Update
themes/template.tswith the new lexer/style definitions - Run
npm run buildto regenerate all themes - The new lexers/styles will be included in all generated themes
.
βββ themes/
β βββ theme-types.ts # TypeScript type definitions
β βββ template.ts # Template with all lexer/style structures
β βββ dracula.ts # Dracula theme colors
β βββ alucard.ts # Alucard theme colors
βββ scripts/
β βββ generate-themes.ts # Theme generator script
β βββ extract-template.ts # One-time script to extract template from XML
βββ generated/
β βββ Dracula.xml # Generated Dracula theme
β βββ Alucard.xml # Generated Alucard theme
βββ package.json # npm configuration
βββ tsconfig.json # TypeScript configuration