mirror of https://github.com/folke/lazy.nvim.git
feat: added vimdoc generation
This commit is contained in:
parent
5ee3bf8f15
commit
0d979b680d
|
@ -26,6 +26,14 @@ jobs:
|
|||
echo "/tmp/nvim/squashfs-root/usr/bin/" >> $GITHUB_PATH
|
||||
- name: Generate docs
|
||||
run: ./build.sh
|
||||
- name: panvimdoc
|
||||
uses: kdheepak/panvimdoc@main
|
||||
with:
|
||||
vimdoc: lazy.nvim
|
||||
version: "Neovim >= 0.8.0"
|
||||
description: "A modern plugin manager for Neovim"
|
||||
demojify: false
|
||||
treesitter: true
|
||||
- name: Push changes
|
||||
uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
|
|
80
README.md
80
README.md
|
@ -1,41 +1,59 @@
|
|||
# Website
|
||||
|
||||
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
|
||||
|
||||
### Installation
|
||||
|
||||
```
|
||||
$ yarn
|
||||
```{.include}
|
||||
docs/intro.md
|
||||
```
|
||||
|
||||
### Local Development
|
||||
|
||||
```
|
||||
$ yarn start
|
||||
```{.include}
|
||||
docs/installation.mdx
|
||||
```
|
||||
|
||||
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
|
||||
|
||||
### Build
|
||||
|
||||
```
|
||||
$ yarn build
|
||||
```{.include}
|
||||
docs/spec/index.md
|
||||
```
|
||||
|
||||
This command generates static content into the `build` directory and can be served using any static contents hosting service.
|
||||
|
||||
### Deployment
|
||||
|
||||
Using SSH:
|
||||
|
||||
```
|
||||
$ USE_SSH=true yarn deploy
|
||||
```{.include}
|
||||
docs/spec/examples.md
|
||||
```
|
||||
|
||||
Not using SSH:
|
||||
|
||||
```
|
||||
$ GIT_USER=<Your GitHub username> yarn deploy
|
||||
```{.include}
|
||||
docs/spec/lazy_loading.md
|
||||
```
|
||||
|
||||
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
|
||||
```{.include}
|
||||
docs/spec/versioning.md
|
||||
```
|
||||
|
||||
```{.include}
|
||||
docs/packages.md
|
||||
```
|
||||
|
||||
```{.include}
|
||||
docs/configuration/index.md
|
||||
```
|
||||
|
||||
```{.include}
|
||||
docs/configuration/highlights.md
|
||||
```
|
||||
|
||||
```{.include}
|
||||
docs/usage/index.md
|
||||
```
|
||||
|
||||
```{.include}
|
||||
docs/usage/lockfile.md
|
||||
```
|
||||
|
||||
```{.include}
|
||||
docs/usage/migration.md
|
||||
```
|
||||
|
||||
```{.include}
|
||||
docs/usage/profiling.md
|
||||
```
|
||||
|
||||
```{.include}
|
||||
docs/usage/structuring.md
|
||||
```
|
||||
|
||||
```{.include}
|
||||
docs/developers.md
|
||||
```
|
|
@ -84,9 +84,52 @@ function M._old()
|
|||
})
|
||||
end
|
||||
|
||||
function M.readme()
|
||||
local mds = vim.fs.find(function(name, path)
|
||||
return name:match(".*%.mdx?$")
|
||||
end, { limit = math.huge, type = "file", path = "docs" })
|
||||
local sorters = {
|
||||
"intro",
|
||||
"installation",
|
||||
"spec",
|
||||
"packages",
|
||||
"configuration",
|
||||
"usage",
|
||||
"developers",
|
||||
}
|
||||
table.sort(mds, function(a, b)
|
||||
local aa = 0
|
||||
local bb = 0
|
||||
for i, name in ipairs(sorters) do
|
||||
if a:match(name) then
|
||||
aa = i
|
||||
end
|
||||
if b:match(name) then
|
||||
bb = i
|
||||
end
|
||||
end
|
||||
if aa == bb then
|
||||
if a:match("index") then
|
||||
return true
|
||||
elseif b:match("index") then
|
||||
return false
|
||||
end
|
||||
return a < b
|
||||
end
|
||||
return aa < bb
|
||||
end)
|
||||
local lines = {}
|
||||
for _, md in ipairs(mds) do
|
||||
table.insert(lines, ("```{.include}\n%s\n```"):format(md))
|
||||
end
|
||||
Util.write_file("README.md", vim.trim(table.concat(lines, "\n\n")))
|
||||
end
|
||||
|
||||
function M.update()
|
||||
M.readme()
|
||||
M.themes()
|
||||
M.docs()
|
||||
vim.cmd.checktime()
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
Loading…
Reference in New Issue