Everyone needs help, so lemmy-help you
lemmy-help
is a emmylua parser as well as a CLI which takes that parsed tree and converts it into vim help docs.
cargo
bash
cargo install lemmy-help --features=cli
```bash
yay -S lemmy-help
paru -S lemmy-help ```
Check out the release page for prebuild binaries available for different operating systems.
To properly generate docs you should follow emmylua spec. The parser is capable of parsing most (not all) of the emmylua syntax. You can read the following doc which can give you the idea on how to properly write emmylua comments.
Using the CLI is simple just give it the path to the lua files; it will parse them and prints the help doc to stdout
bash
lemmy-help /path/to/{first,second,third}.lua > doc.txt
```help lemmy-help
USAGE:
lemmy-help [FLAGS]
ARGS:
FLAGS: -M, --no-modeline Don't print modeline at the end -f, --prefix-func Prefix function name with ---@mod name -a, --prefix-alias Prefix ---@alias tag with return/---@mod name -c, --prefix-class Prefix ---@class tag with return/---@mod name -t, --prefix-type Prefix ---@type tag with ---@mod name -h, --help Print help information -v, --version Print version information
USAGE: lemmy-help /path/to/first.lua /path/to/second.lua > doc.txt lemmy-help -c -a /path/to/{first,second,third}.lua > doc.txt
NOTES: - The order of parsing + rendering is relative to the given files ```
```yaml name: lemmy-help
on: [push]
env: PLUGIN_NAME: plugin-name
jobs: docs: runs-on: ubuntu-latest name: emmylua to vimdoc steps: - uses: actions/checkout@v2
- name: Generating help
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 [args] <path> > doc/${{env.PLUGIN_NAME}}.txt
- name: Commit
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: ${{ github.head_ref }}
commit_message: "chore(docs): auto-generate vimdoc"
file_pattern: doc/*.txt
```