mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +01:00 
			
		
		
		
	feat(code): friendly theme names
This commit is contained in:
		| @@ -198,7 +198,7 @@ function getSyntaxHighlightingThemes() { | |||||||
| function getCodeNoteThemes() { | function getCodeNoteThemes() { | ||||||
|     return ColorThemes.map((theme) => ({ |     return ColorThemes.map((theme) => ({ | ||||||
|         val: `default:${theme.id}`, |         val: `default:${theme.id}`, | ||||||
|         title: theme.id |         title: theme.name | ||||||
|     })); |     })); | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -2,100 +2,124 @@ import type { Extension } from '@codemirror/state'; | |||||||
|  |  | ||||||
| export interface ThemeDefinition { | export interface ThemeDefinition { | ||||||
|     id: string; |     id: string; | ||||||
|  |     name: string; | ||||||
|     load(): Promise<Extension>; |     load(): Promise<Extension>; | ||||||
| } | } | ||||||
|  |  | ||||||
| const themes: ThemeDefinition[] = [ | const themes: ThemeDefinition[] = [ | ||||||
|     { |     { | ||||||
|         id: "abyss", |         id: "abyss", | ||||||
|  |         name: "Abyss", | ||||||
|         load: async () => (await import("@fsegurai/codemirror-theme-abyss")).abyss |         load: async () => (await import("@fsegurai/codemirror-theme-abyss")).abyss | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|         id: "abcdef", |         id: "abcdef", | ||||||
|  |         name: "ABCDEF", | ||||||
|         load: async () => (await import("@fsegurai/codemirror-theme-abcdef")).abcdef |         load: async () => (await import("@fsegurai/codemirror-theme-abcdef")).abcdef | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|         id: "androidStudio", |         id: "androidStudio", | ||||||
|  |         name: "Android Studio", | ||||||
|         load: async () => (await import("@fsegurai/codemirror-theme-android-studio")).androidStudio |         load: async () => (await import("@fsegurai/codemirror-theme-android-studio")).androidStudio | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|         id: "andromeda", |         id: "andromeda", | ||||||
|  |         name: "Andromeda", | ||||||
|         load: async () => (await import("@fsegurai/codemirror-theme-andromeda")).andromeda |         load: async () => (await import("@fsegurai/codemirror-theme-andromeda")).andromeda | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|         id: "basicDark", |         id: "basicDark", | ||||||
|  |         name: "Basic Dark", | ||||||
|         load: async () => (await import("@fsegurai/codemirror-theme-basic-dark")).basicDark |         load: async () => (await import("@fsegurai/codemirror-theme-basic-dark")).basicDark | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|         id: "basicLight", |         id: "basicLight", | ||||||
|  |         name: "Basic Light", | ||||||
|         load: async () => (await import("@fsegurai/codemirror-theme-basic-light")).basicLight |         load: async () => (await import("@fsegurai/codemirror-theme-basic-light")).basicLight | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|         id: "forest", |         id: "forest", | ||||||
|  |         name: "Forest", | ||||||
|         load: async () => (await import("@fsegurai/codemirror-theme-forest")).forest |         load: async () => (await import("@fsegurai/codemirror-theme-forest")).forest | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|         id: "githubDark", |         id: "githubDark", | ||||||
|  |         name: "GitHub Dark", | ||||||
|         load: async () => (await import("@fsegurai/codemirror-theme-github-dark")).githubDark |         load: async () => (await import("@fsegurai/codemirror-theme-github-dark")).githubDark | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|         id: "githubLight", |         id: "githubLight", | ||||||
|  |         name: "GitHub Light", | ||||||
|         load: async () => (await import("@fsegurai/codemirror-theme-github-light")).githubLight |         load: async () => (await import("@fsegurai/codemirror-theme-github-light")).githubLight | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|         id: "gruvboxDark", |         id: "gruvboxDark", | ||||||
|  |         name: "Gruvbox Dark", | ||||||
|         load: async () => (await import("@fsegurai/codemirror-theme-gruvbox-dark")).gruvboxDark |         load: async () => (await import("@fsegurai/codemirror-theme-gruvbox-dark")).gruvboxDark | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|         id: "gruvboxLight", |         id: "gruvboxLight", | ||||||
|  |         name: "Gruvbox Light", | ||||||
|         load: async () => (await import("@fsegurai/codemirror-theme-gruvbox-light")).gruvboxLight |         load: async () => (await import("@fsegurai/codemirror-theme-gruvbox-light")).gruvboxLight | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|         id: "materialDark", |         id: "materialDark", | ||||||
|  |         name: "Material Dark", | ||||||
|         load: async () => (await import("@fsegurai/codemirror-theme-material-dark")).materialDark |         load: async () => (await import("@fsegurai/codemirror-theme-material-dark")).materialDark | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|         id: "materialLight", |         id: "materialLight", | ||||||
|  |         name: "Material Light", | ||||||
|         load: async () => (await import("@fsegurai/codemirror-theme-material-light")).materialLight |         load: async () => (await import("@fsegurai/codemirror-theme-material-light")).materialLight | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|         id: "monokai", |         id: "monokai", | ||||||
|  |         name: "Monokai", | ||||||
|         load: async () => (await import("@fsegurai/codemirror-theme-monokai")).monokai |         load: async () => (await import("@fsegurai/codemirror-theme-monokai")).monokai | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|         id: "nord", |         id: "nord", | ||||||
|  |         name: "Nord", | ||||||
|         load: async () => (await import("@fsegurai/codemirror-theme-nord")).nord |         load: async () => (await import("@fsegurai/codemirror-theme-nord")).nord | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|         id: "palenight", |         id: "palenight", | ||||||
|  |         name: "Palenight", | ||||||
|         load: async () => (await import("@fsegurai/codemirror-theme-palenight")).palenight |         load: async () => (await import("@fsegurai/codemirror-theme-palenight")).palenight | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|         id: "solarizedDark", |         id: "solarizedDark", | ||||||
|  |         name: "Solarized Dark", | ||||||
|         load: async () => (await import("@fsegurai/codemirror-theme-solarized-dark")).solarizedDark |         load: async () => (await import("@fsegurai/codemirror-theme-solarized-dark")).solarizedDark | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|         id: "solarizedLight", |         id: "solarizedLight", | ||||||
|  |         name: "Solarized Light", | ||||||
|         load: async () => (await import("@fsegurai/codemirror-theme-solarized-light")).solarizedLight |         load: async () => (await import("@fsegurai/codemirror-theme-solarized-light")).solarizedLight | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|         id: "tokyoNightDay", |         id: "tokyoNightDay", | ||||||
|  |         name: "Tokyo Night Day", | ||||||
|         load: async () => (await import("@fsegurai/codemirror-theme-tokyo-night-day")).tokyoNightDay |         load: async () => (await import("@fsegurai/codemirror-theme-tokyo-night-day")).tokyoNightDay | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|         id: "tokyoNightStorm", |         id: "tokyoNightStorm", | ||||||
|  |         name: "Tokyo Night Storm", | ||||||
|         load: async () => (await import("@fsegurai/codemirror-theme-tokyo-night-storm")).tokyoNightStorm |         load: async () => (await import("@fsegurai/codemirror-theme-tokyo-night-storm")).tokyoNightStorm | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|         id: "volcano", |         id: "volcano", | ||||||
|  |         name: "Volcano", | ||||||
|         load: async () => (await import("@fsegurai/codemirror-theme-volcano")).volcano |         load: async () => (await import("@fsegurai/codemirror-theme-volcano")).volcano | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|         id: "vsCodeDark", |         id: "vsCodeDark", | ||||||
|  |         name: "VS Code Dark", | ||||||
|         load: async () => (await import("@fsegurai/codemirror-theme-vscode-dark")).vsCodeDark |         load: async () => (await import("@fsegurai/codemirror-theme-vscode-dark")).vsCodeDark | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|         id: "vsCodeLight", |         id: "vsCodeLight", | ||||||
|  |         name: "VS Code Light", | ||||||
|         load: async () => (await import("@fsegurai/codemirror-theme-vscode-light")).vsCodeLight |         load: async () => (await import("@fsegurai/codemirror-theme-vscode-light")).vsCodeLight | ||||||
|     }, |     }, | ||||||
| ] | ] | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user