-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
📝 Rewrite documentation for denops v6 #11
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -2,21 +2,18 @@ name: Test | |||||||||||||||||||
|
||||||||||||||||||||
env: | ||||||||||||||||||||
DENO_VERSION: 1.x | ||||||||||||||||||||
MDBOOK_VERSION: 0.4.36 | ||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Specify exact versions for environment variables to ensure reproducibility and avoid unexpected failures due to version updates. |
||||||||||||||||||||
|
||||||||||||||||||||
on: | ||||||||||||||||||||
push: | ||||||||||||||||||||
branches: | ||||||||||||||||||||
- main | ||||||||||||||||||||
pull_request: | ||||||||||||||||||||
branches: | ||||||||||||||||||||
- main | ||||||||||||||||||||
|
||||||||||||||||||||
jobs: | ||||||||||||||||||||
test: | ||||||||||||||||||||
runs-on: ubuntu-20.04 | ||||||||||||||||||||
runs-on: ubuntu-latest | ||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using |
||||||||||||||||||||
steps: | ||||||||||||||||||||
- uses: actions/checkout@v2 | ||||||||||||||||||||
- uses: actions/cache@v2 | ||||||||||||||||||||
- uses: actions/checkout@v4 | ||||||||||||||||||||
- uses: actions/cache@v4 | ||||||||||||||||||||
with: | ||||||||||||||||||||
path: | | ||||||||||||||||||||
~/.cargo/bin/ | ||||||||||||||||||||
|
@@ -26,17 +23,18 @@ jobs: | |||||||||||||||||||
target/ | ||||||||||||||||||||
.tools/ | ||||||||||||||||||||
key: ${{ runner.os }}-cargo | ||||||||||||||||||||
- uses: denoland/setup-deno@main | ||||||||||||||||||||
- uses: denoland/setup-deno@v1.1.4 | ||||||||||||||||||||
with: | ||||||||||||||||||||
deno-version: ${{ env.DENO_VERSION }} | ||||||||||||||||||||
- uses: actions-rs/toolchain@v1 | ||||||||||||||||||||
with: | ||||||||||||||||||||
toolchain: stable | ||||||||||||||||||||
- name: Format | ||||||||||||||||||||
run: make fmt-check | ||||||||||||||||||||
- name: Install tools | ||||||||||||||||||||
run: make tools | ||||||||||||||||||||
- name: Generate | ||||||||||||||||||||
- name: Install mdBook | ||||||||||||||||||||
run: | | ||||||||||||||||||||
make gen | ||||||||||||||||||||
git diff --check | ||||||||||||||||||||
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf -y | sh | ||||||||||||||||||||
rustup update | ||||||||||||||||||||
cargo install --version ${MDBOOK_VERSION} mdbook | ||||||||||||||||||||
cargo install mdbook-alerts | ||||||||||||||||||||
Comment on lines
+31
to
+34
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The installation of mdBook via curl and rustup should include error handling to ensure the build fails gracefully on errors. + set -e
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf -y | sh
rustup update
cargo install --version ${MDBOOK_VERSION} mdbook
cargo install mdbook-alerts Committable suggestion
Suggested change
|
||||||||||||||||||||
- name: Build with mdBook | ||||||||||||||||||||
run: mdbook build | ||||||||||||||||||||
- name: Format | ||||||||||||||||||||
run: deno fmt --check | ||||||||||||||||||||
- name: Misspell | ||||||||||||||||||||
uses: reviewdog/[email protected] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
/.tools | ||
/book |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"exclude": ["theme/**/*", "book/**/*"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# FAQ | ||
|
||
## How to Check Denops Startup Time | ||
|
||
To check the startup time of Denops or Denops plugins, utilize | ||
[denops-startup-recorder]. This plugin visualizes the timing of events related | ||
to Denops and Denops plugin startup. | ||
|
||
[denops-startup-recorder]: https://github.com/vim-denops/denops-startup-recorder.vim | ||
|
||
It shows the result in echo area like: | ||
|
||
![](./img/faq-1.png) | ||
|
||
## How to Check Denops Performance | ||
|
||
To assess Denops performance, employ [denops-benchmark]. This plugin measures | ||
the number of operations or characters that can be processed in milliseconds. | ||
|
||
[denops-benchmark]: https://github.com/vim-denops/denops-benchmark.vim | ||
|
||
It shows the result in a buffer like: | ||
|
||
![](./img/faq-2.png) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Getting Started | ||
|
||
[Denops] ([/ˈdiːnoʊps/](http://ipa-reader.xyz/?text=%CB%88di%CB%90no%CA%8Aps), | ||
pronounced `dee-nops`) is an ecosystem for [Vim] / [Neovim] that empowers | ||
developers to write plugins in [TypeScript] / [JavaScript] powered by [Deno]. | ||
|
||
Let's start by creating a simple plugin to learn how to develop Denops plugins. | ||
|
||
## Create a Plugin | ||
|
||
Create a directory named `denops-getting-started` in your home directory and a | ||
file named `main.ts` within it, under `denops/denops-getting-started/`: | ||
|
||
``` | ||
$HOME | ||
└── denops-getting-started | ||
└── denops | ||
└── denops-getting-started | ||
└── main.ts | ||
``` | ||
|
||
Next, write the following TypeScript code in `main.ts`: | ||
|
||
```typescript | ||
import type { Denops } from "https://deno.land/x/[email protected]/mod.ts"; | ||
|
||
export function main(denops: Denops): void { | ||
denops.dispatcher = { | ||
async hello() { | ||
await denops.cmd(`echo "Hello, Denops!"`); | ||
}, | ||
}; | ||
} | ||
``` | ||
|
||
## Activate the Plugin | ||
|
||
Add the following line to your Vim or Neovim configuration file (e.g., | ||
`~/.vimrc` or `~/.config/nvim/init.vim`): | ||
|
||
```vim | ||
set runtimepath+=~/denops-getting-started | ||
``` | ||
|
||
Or Neovim Lua configuration file (e.g., `~/.config/nvim/init.lua`): | ||
|
||
```lua | ||
vim.opt.runtimepath:append("~/denops-getting-started") | ||
``` | ||
|
||
## Try the Plugin | ||
|
||
Restart Vim/Neovim and execute the following command: | ||
|
||
```vim | ||
:call denops#request('denops-getting-started', 'hello', []) | ||
``` | ||
|
||
You should see "Hello, Denops!" displayed on the screen like: | ||
|
||
![](./img/README-01.png) | ||
|
||
[Denops]: https://github.com/vim-denops/denops.vim | ||
[Vim]: https://www.vim.org/ | ||
[Neovim]: https://neovim.io/ | ||
[TypeScript]: https://www.typescriptlang.org/ | ||
[JavaScript]: https://developer.mozilla.org/en-US/docs/Web/JavaScript | ||
[Deno]: https://deno.land/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renaming the workflow to "Deploy" simplifies its purpose but consider a more descriptive name for clarity.