-
Notifications
You must be signed in to change notification settings - Fork 85
52 lines (44 loc) · 1.95 KB
/
docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Auto Generate Docs
permissions:
contents: write
on:
push:
branches: [main]
jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Install Neovim
uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: nightly
- name: Install Neovim plugins
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: Generate markdown docs
run: bash ./scripts/autogen.sh
- name: Generate vimdoc
run: |
export PATH="${PWD}/build/:${PATH}"
export PACKPATH=$HOME/.local/share/nvim/site
script=~/.local/share/nvim/site/pack/vendor/start/ts-vimdoc.nvim/scripts/init.lua
nvim --headless -u $script -c "lua require('ts-vimdoc').docgen({ project_name='null-ls', input_file='README.md', output_file='doc/null-ls.txt' })" -c "qa"
# files=(BUILTINS BUILTIN_CONFIG CONFIG CONTRIBUTING HELPERS MAIN SOURCES TESTING)
# for file in "${files[@]}"; do
# nvim --headless -u $script -c "lua require('ts-vimdoc').docgen({ project_name='null-ls', input_file='doc/$file.md', output_file='doc/$file.txt' })" -c "qa"
# done
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: 'chore: Auto generate docs'