Skip to content

Commit

Permalink
chore(doc): update document
Browse files Browse the repository at this point in the history
  • Loading branch information
BYT0723 committed Mar 18, 2023
1 parent 58a4cd1 commit 0c60f27
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 4 deletions.
47 changes: 46 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,42 @@
- packer.nvim

```lua
use({ "BYT0723/goctl.nvim", run = ":GoctlUpgrade" })
use({ "BYT0723/goctl.nvim", run = ":GoctlUpgrade", requires = {"MunifTanjim/nui.nvim"} })

-- recommend
use("rcarriga/nvim-notify")
```

## Init

```lua
require("goctl").setup()
```

## Features

- Validate

> goctl valid when vim event "BufRead", "TextChanged", "TextChangedI".
- Format

use command `GoctlApiFormat` or lua

```lua
-- format when write file
vim.api.nvim_command("au BufWritePre *.api lua require('goctl.api').format()")
```

- ApiMenu
use command `GoctlApi` or lua

```lua
require("goctl.api").menu()
```

## Preview

<details>
<summary>Code Diagnostic</summary>
<img src="./images/goctl-diagnostic.gif" />
Expand All @@ -22,6 +53,20 @@ use({ "BYT0723/goctl.nvim", run = ":GoctlUpgrade" })
<img src="./images/goctl-format.gif" />
</details>

<details>
<summary>Api</summary>
<img src="./images/goctl_api_menu.jpg" />
</details>

<details>
<summary>ApiNew</summary>
<img src="./images/goctl_api_new.jpg" />
</details>
<details>
<summary>ApiGenerate</summary>
<img src="./images/goctl_api_generate.jpg" />
</details>

## Other

> plugin is being developed. We look forward to your participation and suggestions
Binary file added images/goctl_api_generate.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/goctl_api_menu.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/goctl_api_new.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions lua/goctl/api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function M.new()
job:new(cmd)
end

input:new("Path", "greet", on_submit):display()
input:new("New Service", "greet", on_submit):display()
end

function M.doc()
Expand Down Expand Up @@ -170,10 +170,10 @@ function M.generate()
local type_submit = function(item)
table.insert(cmd, item.id)
type = item.id
input:new("Path", util.filename_ex_suffix(), dir_submit):display()
input:new("Dir", util.filename_ex_suffix(), dir_submit):display()
end

menu:new("Api Generate", {
menu:new("Service Language", {
{ text = "Golang", id = "go" },
{ text = "Typescript", id = "ts" },
{ text = "Dart", id = "dart" },
Expand Down

0 comments on commit 0c60f27

Please sign in to comment.