feat: add support for neovim v0.9 (#60) #104
This file contains 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: panvimdoc | |
on: | |
push: | |
branches: | |
- '**' | |
paths: | |
- README.md | |
- .github/workflows/vimdocs.yml | |
- doc/** | |
- lua/kitty-scrollback/launch.lua | |
- lua/kitty-scrollback/api.lua | |
workflow_dispatch: | |
jobs: | |
vimdoc: | |
runs-on: ubuntu-latest | |
name: generate vimdoc | |
steps: | |
- uses: actions/checkout@v2 | |
- name: lemmyhelp | |
run: | | |
curl -Lq https://github.com/numToStr/lemmy-help/releases/latest/download/lemmy-help-x86_64-unknown-linux-gnu.tar.gz | tar xz | |
./lemmy-help -c -a -f lua/kitty-scrollback/launch.lua lua/kitty-scrollback/api.lua > doc/kitty-scrollback.nvim_spec.txt | |
- name: preformat README.md | |
run: | | |
mkdir -p tmp_vimdoc_workdir | |
cp README.md tmp_vimdoc_workdir/README.md | |
sed -E -e's/\[!(NOTE|WARNING|IMPORTANT)\].*/[!\1]\n>/Ig' -e 's/.*<summary>(.+)<\/summary>/- VIMDOC_SUMMARY_HEADER `\1`\n/g' \ | |
-e 's/<a.*href.*"(.+)".*>(.+)<\/a>/\2 <\1>/g' <README.md >tmp_vimdoc_workdir/README.md | |
- name: panvimdoc | |
uses: kdheepak/panvimdoc@main | |
with: | |
vimdoc: kitty-scrollback.nvim | |
pandoc: "tmp_vimdoc_workdir/README.md" | |
version: "NVIM v0.9+" | |
toc: true | |
demojify: true | |
dedupsubheadings: false | |
treesitter: true | |
- name: postformat kitty-scrollback.nvim.txt | |
run: | | |
cp doc/kitty-scrollback.nvim.txt tmp_vimdoc_workdir/kitty-scrollback.nvim.txt | |
sed -E \ | |
-e 's/\[!(IMPORTANT)\]/|‼| |\1|/Ig' \ | |
-e 's/\[!(NOTE)\]/`ℹ` `\1` /Ig' \ | |
-e 's/\[!(WARNING)\]/*⚠* *\1* /Ig' \ | |
-e 's/^- VIMDOC_SUMMARY_HEADER(.*)/\n`-`\1/g' \ | |
-e 's/^[[:space:]]+(>.*)/\n\1/g' \ | |
-e 's/^[[:space:]]+(<.*)/\1/g' \ | |
<tmp_vimdoc_workdir/kitty-scrollback.nvim.txt >doc/kitty-scrollback.nvim.txt | |
- name: cleanup preformat README.md | |
run: | | |
rm -rf tmp_vimdoc_workdir | |
- uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
branch: ${{ github.head_ref }} | |
commit_message: "chore(build): auto-generate vimdoc" | |
commit_user_name: "github-actions[bot]" | |
commit_user_email: "github-actions[bot]@users.noreply.github.com" | |
commit_author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>" | |
file_pattern: doc/*.txt | |