Skip to content

Commit c76c393

Browse files
committed
Update workflow
1 parent 82ff4a1 commit c76c393

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,58 @@ The reference implementation of the Pandoc lua filter is in [panvimdoc.lua](./sc
5858

5959
If you would like to contribute to the specification please feel free to comment on this issue: <https://github.com/kdheepak/panvimdoc/issues/1>.
6060

61+
# Usage
62+
63+
```bash
64+
pandoc -t scripts/panvimdoc.lua ${INPUT} ${OUTPUT}
65+
```
66+
67+
The following are the metadata fields that the custom writer uses:
68+
69+
- `project` (String) _required_: This is typically the plugin name. This is prefixed to all generated tags
70+
- `vimdoctitle` (String) _required_: This is the name of the documentation file that you want to generate
71+
- `vimversion` (String) _optional_: The version vim / neovim that the plugin is targeting. If not present, the version of vim in the available environment is used.
72+
- `toc` (Boolean) _optional_: Whether to generate table of contents or not
73+
74+
Example:
75+
76+
```markdown
77+
---
78+
project: panvimdoc
79+
vimdoctitle: panvimdoc.txt
80+
vimversion: Neovim v0.5.0
81+
toc: true
82+
---
83+
```
84+
85+
## Using Github Actions
86+
87+
Add the following to `./.github/workflows/pandocvim.yml`:
88+
89+
```yaml
90+
name: panvimdoc
91+
92+
on: [push]
93+
94+
jobs:
95+
custom_test:
96+
runs-on: ubuntu-latest
97+
name: pandoc to vimdoc
98+
steps:
99+
- uses: actions/checkout@v2
100+
- name: PanVimDoc
101+
uses: kdheepak/panvimdoc@v1
102+
with:
103+
pandoc: INPUT_FILENAME.md
104+
vimdoc: doc/OUTPUT_FILENAME.txt
105+
- uses: stefanzweifel/git-auto-commit-action@v4
106+
with:
107+
commit_message: "Auto generate docs"
108+
branch: ${{ github.head_ref }}
109+
```
110+
111+
Choose `INPUT_FILENAME` and `OUTPUT_FILENAME` appropriately.
112+
61113
# References
62114

63115
- <https://learnvimscriptthehardway.stevelosh.com/chapters/54.html>

0 commit comments

Comments
 (0)