• Stars
    star
    127
  • Rank 282,790 (Top 6 %)
  • Language
    Rust
  • License
    MIT License
  • Created over 2 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Every one needs help, so lemmy-help you! A CLI to generate vim/nvim help doc from emmylua

🀝 lemmy-help

Everyone needs help, so lemmy-help you

lemmy-help

What?

lemmy-help is a emmylua parser as well as a CLI which takes that parsed tree and converts it into vim help docs.

Installation

  • Using cargo
cargo install lemmy-help --features=cli
  • Arch Linux
# Using yay
yay -S lemmy-help

# Using paru
paru -S lemmy-help
  • Using releases

Check out the release page for prebuild binaries available for different operating systems.

Emmylua

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.

Usage

Using the CLI is simple just give it the path to the lua files; it will parse them and prints help doc onto stdout

lemmy-help /path/to/{first,second,third}.lua > doc/PLUGIN_NAME.txt

Cli

lemmy-help

USAGE:
    lemmy-help [FLAGS] [OPTIONS] <FILES>...

ARGS:
    <FILES>...                  Path to lua files

FLAGS:
    -h, --help                  Print help information
    -v, --version               Print version information
    -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
        --expand-opt            Expand '?' (optional) to 'nil' type

OPTIONS:
    -i, --indent <u8>           Controls the indent width [default: 4]
    -l, --layout <layout>       Vimdoc text layout [default: 'default']
                                - "default" : Default layout
                                - "compact[:n=0]" : Aligns [desc] with <type>
                                  and uses {n}, if provided, to indent the
                                  following new lines. This option only
                                  affects ---@field and ---@param tags
                                - "mini[:n=0]" : Aligns [desc] from the start
                                  and uses {n}, if provided, to indent the
                                  following new lines. This option affects
                                  ---@field, ---@param and ---@return tags

USAGE:
    lemmy-help /path/to/first.lua /path/to/second.lua > doc/PLUGIN_NAME.txt
    lemmy-help -c -a /path/to/{first,second,third}.lua > doc/PLUGIN_NAME.txt
    lemmy-help --layout compact:2 /path/to/plugin.lua > doc/PLUGIN_NAME.txt

NOTES:
    - The order of parsing + rendering is relative to the given files

CI

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

Credits

More Repositories

1

Comment.nvim

🧠 πŸ’ͺ // Smart and powerful comment plugin for neovim. Supports treesitter, dot repeat, left-right/up-down motions, hooks, and more
Lua
2,434
star
2

FTerm.nvim

πŸ”₯ No-nonsense floating terminal plugin for neovim πŸ”₯
Lua
605
star
3

Navigator.nvim

✨ Smoothly navigate between neovim and terminal multiplexer(s) ✨
Lua
301
star
4

dotfiles

🏑 /.dotfiles | Includes configs for neovim, tmux, zsh, alacrity, kitty, and more | Managed by GNU stow
Lua
274
star
5

snm

🀏 Smol and simple node version manager written in rust πŸ¦€
Rust
98
star
6

BufOnly.nvim

Lua/Neovim port of BufOnly.vim with some changes
Lua
31
star
7

zenv

Dotenv (.env) loader written in rust πŸ¦€
Rust
28
star
8

Surround.nvim

[Alpha] Incoming successor to vim-surround
Lua
23
star
9

Sakura.nvim

Nice color scheme for neovim
Lua
21
star
10

prettierrc.nvim

Apply editor settings from prettier config
Lua
19
star
11

site

Personal portfolio and blog
JavaScript
18
star
12

random.ly

Real Time Chat App built with React, Redux, React Router, Node.js, Express, MongoDB and Socket.io
JavaScript
6
star
13

ky

πŸ”‘ ky - Simple and secure password manager
Rust
2
star
14

traefik-ecs-fargate

HCL
2
star
15

Buffers.nvim

Some useful functions to deal with buffers
Lua
1
star
16

react-image-uploader

Demo:
JavaScript
1
star
17

ender3v3ke_klipper

Klipper backup config for Ender 3 v3 KE
Python
1
star
18

dark-black-portfolio

Dark & Flat Design Portfolio
CSS
1
star
19

crafting-interpreters

Rust
1
star
20

dockerfiles

A collection of dockerfiles for different projects πŸ˜–
Dockerfile
1
star
21

listrrr

Issue and Project tracker build w/ GraphQl, Apollo & React πŸ”₯. Wrapped with πŸ‹ Docker.
TypeScript
1
star
22

nodegen

A CLI tool for creating nodejs app πŸš€
JavaScript
1
star
23

gruvbox-material

Fork of gruvbox-material
Vim Script
1
star
24

gotodo

A small todo backend built with golang, sqlite
Go
1
star