From ac491f12305446399196425b9165cfcf566ec811 Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Sun, 18 Feb 2024 01:21:00 -0800 Subject: [PATCH] garden: generate documentation using panvimdoc --- .github/workflows/push.yaml | 37 ++++++++++++++++++++ .gitignore | 1 + README.md | 2 +- garden.yaml | 70 +++++++++++++++++++++++++------------ 4 files changed, 87 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/push.yaml diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml new file mode 100644 index 0000000..6b7bd82 --- /dev/null +++ b/.github/workflows/push.yaml @@ -0,0 +1,37 @@ +name: Generate docs and format code +on: + push: + branches: ['main', 'dev'] +jobs: + postprocessing: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - run: sudo add-apt-repository ppa:neovim-ppa/stable + - run: sudo apt-get update + - run: sudo apt-get install -y bash neovim pandoc + - run: rustup toolchain install stable --profile minimal --no-self-update + - run: cargo install garden-tools + - run: cargo install stylua + - uses: actions/checkout@v3 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + - name: Generate docs + uses: kdheepak/panvimdoc@main + with: + description: ' Telescope plugin for searching repositories using "git grep"' + vimdoc: telescope-git-grep + pandoc: README.md + toc: 'false' + - run: garden -vv doc/post + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_author: cowcat + commit_message: 'doc: generate vim docs' + - run: garden -vv fmt + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_author: fatcat + commit_message: 'lua: code formatting' diff --git a/.gitignore b/.gitignore index 8db40be..f30272e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /.luarc.json +/panvimdoc diff --git a/README.md b/README.md index 2d8dd6c..fceaf12 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# telescope-git-grep.nvim +# telescope-git-grep *Telescope Git Grep* is a [telescope](https://github.com/nvim-telescope/telescope.nvim) extension that uses `git grep` to search tracked files. diff --git a/garden.yaml b/garden.yaml index 67ca0c8..1e083ae 100644 --- a/garden.yaml +++ b/garden.yaml @@ -2,29 +2,55 @@ # Usage: # garden check # garden fmt -commands: - check>: - - luacheck - - check/fmt - luacheck: luacheck lua/* - check/fmt: garden fmt -- --check - fmt: | - stylua \ - --call-parentheses Always \ - --column-width 88 \ - --indent-type Spaces \ - --quote-style AutoPreferSingle \ - "$@" \ - lua/*/*.lua - +# +# Generate documentation +# garden setup # One-time setup +# garden doc trees: - telescope-git-grep.nvim: + telescope-git-grep: + description: Telescope plugin for searching repositories using "git grep" path: ${GARDEN_CONFIG_DIR} - url: git@gitlab.com:davvid/telescope-git-grep.nvim + url: git@gitlab.com:davvid/telescope-git-grep.nvim.git + remotes: + github: git@github.com:davvid/telescope-git-grep.nvim.git + llllvvuu: git@github.com:llllvvuu/telescope-git-grep.nvim.git gitconfig: remote.publish.pushurl: - - git@gitlab.com:davvid/telescope-git-grep.nvim - - git@github.com:davvid/telescope-git-grep.nvim - remotes: - github: git@github.com:davvid/telescope-git-grep.nvim - llllvvuu: git@github.com:llllvvuu/telescope-git-grep.nvim + - git@gitlab.com:davvid/telescope-git-grep.nvim.git + - git@github.com:davvid/telescope-git-grep.nvim.git + environment: + PATH: ${GARDEN_CONFIG_DIR}/panvimdoc + commands: + check>: + - check/lua + - check/fmt + check/fmt: garden fmt -- --check + check/lua: luacheck lua/* + doc: | + panvimdoc.sh \ + --description ' Telescope plugin for searching repositories using "git grep"' \ + --input-file README.md \ + --project-name ${TREE_NAME} \ + --toc false + doc>: + - doc/post + doc/post: | + sed -i -e 's/Generated by panvimdoc.*//' doc/${TREE_NAME}.txt + nvim +'helptags doc | exit' + fmt: | + stylua \ + --call-parentheses Always \ + --column-width 88 \ + --indent-type Spaces \ + --quote-style AutoPreferSingle \ + "$@" \ + lua/*/*.lua + setup: | + garden -vv grow panvimdoc + garden -vv setup panvimdoc + + panvimdoc: + description: Generate vimdoc documentation from pandoc markdown + url: https://github.com/kdheepak/panvimdoc.git + commands: + setup: sudo apt install pandoc