feat: added vimdoc generation

This commit is contained in:
Folke Lemaitre 2024-06-23 19:38:39 +02:00
parent 5ee3bf8f15
commit 0d979b680d
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
4 changed files with 100 additions and 31 deletions

View File

@ -26,6 +26,14 @@ jobs:
echo "/tmp/nvim/squashfs-root/usr/bin/" >> $GITHUB_PATH echo "/tmp/nvim/squashfs-root/usr/bin/" >> $GITHUB_PATH
- name: Generate docs - name: Generate docs
run: ./build.sh 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 - name: Push changes
uses: stefanzweifel/git-auto-commit-action@v5 uses: stefanzweifel/git-auto-commit-action@v5
with: with:

View File

@ -1,41 +1,59 @@
# Website ```{.include}
docs/intro.md
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
### Installation
```
$ yarn
``` ```
### Local Development ```{.include}
docs/installation.mdx
```
$ yarn start
``` ```
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. ```{.include}
docs/spec/index.md
### Build
```
$ yarn build
``` ```
This command generates static content into the `build` directory and can be served using any static contents hosting service. ```{.include}
docs/spec/examples.md
### Deployment
Using SSH:
```
$ USE_SSH=true yarn deploy
``` ```
Not using SSH: ```{.include}
docs/spec/lazy_loading.md
```
$ GIT_USER=<Your GitHub username> yarn deploy
``` ```
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
```

0
doc/.keep Normal file
View File

View File

@ -84,9 +84,52 @@ function M._old()
}) })
end 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() function M.update()
M.readme()
M.themes() M.themes()
M.docs() M.docs()
vim.cmd.checktime()
end end
return M return M