docs: mention options like winopts can be passed as function
#1096
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: vimdoc | |
| on: | |
| push: | |
| branches: [main, vimdoc] | |
| jobs: | |
| generate-docs: | |
| runs-on: [ubuntu-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: rhysd/action-setup-vim@v1 | |
| with: | |
| neovim: true | |
| version: v0.10.3 | |
| - name: Setup treesitter | |
| run: | | |
| mkdir -p ~/.local/share/nvim/site/pack/vendor/start | |
| git clone --depth 1 https://github.com/ibhagwan/ts-vimdoc.nvim ~/.local/share/nvim/site/pack/vendor/start/ts-vimdoc.nvim | |
| git clone --depth 1 https://github.com/nvim-treesitter/nvim-treesitter ~/.local/share/nvim/site/pack/vendor/start/nvim-treesitter | |
| - name: Build parser | |
| run: | | |
| export PACKPATH=$HOME/.local/share/nvim/site | |
| nvim --headless -u ~/.local/share/nvim/site/pack/vendor/start/ts-vimdoc.nvim/scripts/init.lua -c "TSUpdateSync markdown" -c "TSUpdateSync markdown_inline" -c "qa" | |
| - name: Generating docs | |
| run: | | |
| export PATH="${PWD}/build/:${PATH}" | |
| export PACKPATH=$HOME/.local/share/nvim/site | |
| nvim --headless -u ~/.local/share/nvim/site/pack/vendor/start/ts-vimdoc.nvim/scripts/init.lua -c "lua require('ts-vimdoc').docgen({input_file='README.md', output_file='doc/fzf-lua.txt', project_name='fzf-lua', version='For Neovim >= 0.7.0'})" -c "qa" | |
| - name: Commit changes | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| COMMIT_MSG: | | |
| [docgen] CI: autogenerate vimdoc | |
| skip-checks: true | |
| run: | | |
| git config user.email "actions@github" | |
| git config user.name "Github Actions" | |
| git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git | |
| git add doc/fzf-lua.txt | |
| # Only commit and push if we have changes | |
| git diff --quiet && git diff --staged --quiet || (git commit -m "${COMMIT_MSG}"; git push origin HEAD:${GITHUB_REF}) |