Entry point for parsing theme metadata

This commit is contained in:
Kovid Goyal
2023-05-04 10:14:58 +05:30
parent 8ba7258db9
commit 3eb18a416a
3 changed files with 48 additions and 2 deletions

View File

@@ -54,6 +54,7 @@ func KittyToolEntryPoints(root *cli.Command) {
diff.EntryPoint(root)
// themes
themes.EntryPoint(root)
themes.ParseEntryPoint(root)
// __pytest__
pytest.EntryPoint(root)
// __hold_till_enter__

View File

@@ -463,7 +463,7 @@ type ThemeMetadata struct {
Author string `json:"author"`
}
func parse_theme_metadata(path string) (*ThemeMetadata, map[string]string, error) {
func ParseThemeMetadata(path string) (*ThemeMetadata, map[string]string, error) {
var in_metadata, in_blurb, finished_metadata bool
ans := ThemeMetadata{}
settings := map[string]string{}
@@ -816,7 +816,7 @@ func (self *Themes) Filtered(is_ok func(*Theme) bool) *Themes {
}
func (self *Themes) AddFromFile(path string) (*Theme, error) {
m, conf, err := parse_theme_metadata(path)
m, conf, err := ParseThemeMetadata(path)
if err != nil {
return nil, err
}