diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index ec1d1b5..80a7edd 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -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: diff --git a/README.md b/README.md index 0c6c2c2..a090408 100644 --- a/README.md +++ b/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= 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 +``` \ No newline at end of file diff --git a/doc/.keep b/doc/.keep new file mode 100644 index 0000000..e69de29 diff --git a/lua/build.lua b/lua/build.lua index 22d63b1..4f60093 100644 --- a/lua/build.lua +++ b/lua/build.lua @@ -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