diff --git a/.workflow/info.plist b/.workflow/info.plist index f796388..753edf4 100644 --- a/.workflow/info.plist +++ b/.workflow/info.plist @@ -96,6 +96,26 @@ vitoclose + + destinationuid + 18D6F575-4589-45B7-827B-B182C18E240A + modifiers + 131072 + modifiersubtext + 打开Docs中该Repo的qs + vitoclose + + + + destinationuid + B53BF6E6-F247-47F7-976E-2AB8E78A683E + modifiers + 262144 + modifiersubtext + 打开文档 + vitoclose + + createdby @@ -370,6 +390,48 @@ version 1 + + config + + browser + + skipqueryencode + + skipvarencode + + spaces + + url + + + type + alfred.workflow.action.openurl + uid + 18D6F575-4589-45B7-827B-B182C18E240A + version + 1 + + + config + + browser + + skipqueryencode + + skipvarencode + + spaces + + url + + + type + alfred.workflow.action.openurl + uid + B53BF6E6-F247-47F7-976E-2AB8E78A683E + version + 1 + readme @@ -378,7 +440,7 @@ 04D6D214-AEBC-4782-BC3F-E2EB3AED641C xpos - 775 + 820 ypos 15 @@ -389,6 +451,13 @@ ypos 365 + 18D6F575-4589-45B7-827B-B182C18E240A + + xpos + 730 + ypos + 720 + 526CF41F-8FC3-49B8-85F8-BDE912B219B5 xpos @@ -428,6 +497,13 @@ ypos 505 + B53BF6E6-F247-47F7-976E-2AB8E78A683E + + xpos + 1075 + ypos + 745 + E90320D8-B030-405D-A597-184E2218A0BA note @@ -440,48 +516,6 @@ userconfigurationconfig - - config - - default - ff - placeholder - - required - - trim - - - description - - label - Keyword - type - textfield - variable - qs - - - config - - default - fc - placeholder - - required - - trim - - - description - - label - Keyword - type - textfield - variable - qs2 - config @@ -507,7 +541,7 @@ config default - gh + https://docs.hxha.xyz/x/gh/ placeholder required @@ -516,19 +550,19 @@ description - + Docs URL label - + Docs URL type textfield variable - gh + docs config default - ch + gh placeholder required @@ -537,19 +571,19 @@ description - + Custom Key for gh.yml label - + gh.yml type textfield variable - ch + gh config default - goods + ch placeholder required @@ -558,17 +592,17 @@ description - + Custom Key for ws.yml label - + ws.yml type textfield variable - goods + ch version - 1.1.0 + 1.4.0 webaddress https://github.com/91go/docs-alfred diff --git a/cmd/f.go b/cmd/f.go index 246fd0e..09de51c 100644 --- a/cmd/f.go +++ b/cmd/f.go @@ -81,10 +81,11 @@ const ( ) // ghCmd represents the repo command -// Enter 直接打开URL -// CMD + Enter Markdown View -// Ctrl + Enter Copy URL -// Shift + Enter 打开在docs项目对应heading的URL +// Enter 直接打开URL +// CMD + Enter Markdown View +// Option + Enter Copy URL +// Ctrl + Enter 打开文档 +// Shift + Enter 打开在docs项目对应heading的URL var ghCmd = &cobra.Command{ Use: "gh", Short: "Searching from starred repositories and my repositories", @@ -96,19 +97,13 @@ var ghCmd = &cobra.Command{ } ghs := gh.NewConfigRepos(data).ToRepos() - repos = append(ghs, repos...) - if len(args) > 0 && strings.HasPrefix(args[0], "#") { tags := repos.ExtractTags() // if hit tag ptag := strings.TrimPrefix(args[0], "#") if slices.Contains(tags, ptag) { - // for _, tagRepo := range { - // name := tagRepo.FullName() - // wf.NewItem(name).Title(name).Valid(false).Autocomplete(name) - // } repos = repos.QueryReposByTag(ptag) RenderRepos(repos) } else { @@ -288,8 +283,12 @@ func RenderRepos(repos gh.Repos) (item *aw.Item) { Valid(true). Autocomplete(name).Icon(&aw.Icon{Value: iconPath}) - item.Cmd().Subtitle(fmt.Sprintf("Open URL: %s", repoURL)).Arg(remark.String()) - item.Opt().Subtitle(fmt.Sprintf("Copy URL: %s", repoURL)).Arg(repoURL) + docsURL := fmt.Sprintf("%s#%s", wf.Config.GetString("docs"), strings.ToLower(repo.Tag)) + + item.Cmd().Subtitle(fmt.Sprintf("Quicklook: %s", repoURL)).Arg(remark.String()) + item.Opt().Subtitle(fmt.Sprintf("复制URL: %s", repoURL)).Arg(repoURL) + item.Ctrl().Subtitle(fmt.Sprintf("打开文档: %s", repo.Doc)).Arg(repo.Doc) + item.Shift().Subtitle(fmt.Sprintf("打开该Repo在Docs中gh.md的URL: %s", docsURL)).Arg(docsURL) } return item }