Update README.md

This commit is contained in:
bryant-the-coder
2022-01-23 20:12:45 +08:00
parent 7e7fbc4ff2
commit 62700b9fea

View File

@@ -1,23 +1,27 @@
<div align="center"> <div align="center">
<img src="https://user-images.githubusercontent.com/5306901/141127528-ddff21bb-8da3-43da-8efe-9494a4f231d2.png" width=250><br> <img src="https://user-images.githubusercontent.com/5306901/141127528-ddff21bb-8da3-43da-8efe-9494a4f231d2.png" width=250><br>
# Neogen - Your Annotation Toolkit # Neogen - Your Annotation Toolkit
[![Neovim](https://img.shields.io/badge/Neovim%200.5+-green.svg?style=for-the-badge&logo=neovim)](https://neovim.io) [![Neovim](https://img.shields.io/badge/Neovim%200.5+-green.svg?style=for-the-badge&logo=neovim)](https://neovim.io)
[![Lua](https://img.shields.io/badge/Lua-blue.svg?style=for-the-badge&logo=lua)](http://www.lua.org) [![Lua](https://img.shields.io/badge/Lua-blue.svg?style=for-the-badge&logo=lua)](http://www.lua.org)
</div> </div>
# Table Of Contents # Table Of Contents
* [Features](#features) - [Neogen - Your Annotation Toolkit](#neogen---your-annotation-toolkit)
* [Requirements](#requirements) - [Table Of Contents](#table-of-contents)
* [Installation](#installation) - [Features](#features)
* [Usage](#usage) - [Requirements](#requirements)
* [Configuration](#configuration) - [Installation](#installation)
* [Supported Languages](#supported-languages) - [Usage](#usage)
* [Adding Languages](#adding-languages) - [Cycle between annotations](#cycle-between-annotations)
* [GIFS](#gifs) - [Configuration](#configuration)
- [Supported Languages](#supported-languages)
- [Adding Languages](#adding-languages)
- [GIFS](#gifs)
- [Credits](#credits)
## Features ## Features
@@ -37,8 +41,8 @@
Use your favorite package manager to install Neogen, e.g: Use your favorite package manager to install Neogen, e.g:
```lua ```lua
use { use {
"danymat/neogen", "danymat/neogen",
config = function() config = function()
require('neogen').setup { require('neogen').setup {
enabled = true enabled = true
@@ -55,10 +59,10 @@ use {
```vim ```vim
" will generate annotation for the function you're inside " will generate annotation for the function you're inside
:Neogen :Neogen
" or you can force a certain type of annotation. " or you can force a certain type of annotation.
" It'll find the next upper node that matches the type " It'll find the next upper node that matches the type
" E.g if you're on a method of a class and do `:Neogen class`, it'll find the class declaration and generate the annotation. " E.g if you're on a method of a class and do `:Neogen class`, it'll find the class declaration and generate the annotation.
:Neogen func|class|type|... :Neogen func|class|type|...
``` ```
- If you like to use the lua API, I exposed a function to generate the annotations. - If you like to use the lua API, I exposed a function to generate the annotations.
@@ -107,7 +111,7 @@ If you want to use a key that's already used for completion purposes, take a loo
<details> <details>
<summary>nvim-cmp</summary> <summary>nvim-cmp</summary>
```lua ```lua
local cmp = require('cmp') local cmp = require('cmp')
local neogen = require('neogen') local neogen = require('neogen')
@@ -180,41 +184,39 @@ require('neogen').setup {
} }
} }
``` ```
Check out `:h neogen-advanced_configurations` for more information ! Check out `:h neogen-advanced_configurations` for more information !
## Supported Languages ## Supported Languages
There is a list of supported languages and fields, with their annotation style There is a list of supported languages and fields, with their annotation style
| Language | Annotation conventions | Supported fields | Supported annotation types | Languages | Annotation Conventions | Supported annotation types |
|---|---|---|---| | --------------- | ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| lua | | | `func`, `class`, `type`, `file` | | lua | [Emmylua](https://emmylua.github.io/) (`"emmylua"`) | `@func`, `@class`, `@type`, `@file` |
| | [Emmylua](https://emmylua.github.io/) (`"emmylua"`) | `@param`, `@varargs`, `@return`, `@class`, `@type`, `@module` | | | [Ldoc](https://stevedonovan.github.io/ldoc/manual/doc.md.html) (`"ldoc"`) | |
| | [Ldoc](https://stevedonovan.github.io/ldoc/manual/doc.md.html) (`"ldoc"`) | `@param`, `@varargs`, `@return`, `@class`, `@type` | | --------------- | ---------------------------------------------------------------------------------------------------------------------- | |
| python | | | `func`, `class`, `file`, `type` | | python | [Google docstrings](https://google.github.io/styleguide/pyguide.html) (`"google_docstrings"`) | |
| | [Google docstrings](https://google.github.io/styleguide/pyguide.html) (`"google_docstrings"`) | `Args`, `Attributes`, `Returns` | | | [Numpydoc](https://numpydoc.readthedocs.io/en/latest/format.html) (`"numpydoc"`) | |
| | [Numpydoc](https://numpydoc.readthedocs.io/en/latest/format.html) (`"numpydoc"`)| `Arguments`, `Attributes`, `Returns`| | --------------- | ---------------------------------------------------------------------------------------------------------------------- | |
| javascript | | | `func`, `class`, `file`, `type`| | javascript | [JSDoc](https://jsdoc.app) (`"jsdoc"`) | |
| | [JSDoc](https://jsdoc.app) (`"jsdoc"`) | `@param`, `@returns`, `@class`, `@classdesc`, `@module`, `@type`| | typescript | | |
| typescript | | | `func`, `class`, `file`, `type` | | --------------- | ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| | [JSDoc](https://jsdoc.app) (`"jsdoc"`) | `@param`, `@returns`, `@class`, `@classdesc`, `@type`, `@module`| | c | [Doxygen](https://www.doxygen.nl/manual/commands.html) (`"doxygen"`) | `@func`, `@file` |
| c | | | `func`, `file`| | --------------- | ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| | [Doxygen](https://www.doxygen.nl/manual/commands.html) (`"doxygen"`) | `@param`, `@return`, `@brief`, `@file`| | cpp | [Doxygen](https://www.doxygen.nl/manual/commands.html) (`"doxygen"`) | `@func`, `@file`, `@class` |
| cpp | | | `func`, `file`, `class`| | --------------- | ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| | [Doxygen](https://www.doxygen.nl/manual/commands.html) (`"doxygen"`) | `@param`, `@return`, `@tparam`, `@brief`, `@file`, `@class`| | go | [GoDoc](https://go.dev/blog/godoc) (`"godoc"`) | `@func`, `@type` |
| go | | | `func`, `type` | | --------------- | ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| | [Godoc](https://go.dev/blog/godoc) (`"godoc"`) | | | java | [Javadoc](https://docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/javadoc.html#documentationcomments) (`"javadoc`) | `@func`, `@class` |
| java | | | `func`, `class` | | --------------- | ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| | [Javadoc](https://docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/javadoc.html#documentationcomments) (`"javadoc"`) | `@param`, `@return`, `@throws`| | rust | [RustDoc](https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) (`"rustdoc"`) | `@func`, `@file`, `@class` |
| rust | | | `func`, `file`, `class` | | | [Alternative](https://stackoverflow.com/questions/30009650/how-do-you-document-function-arguments) (`"alternative"`) | |
| | [Rustdoc](https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) (`"rustdoc"`) | | | --------------- | ---------------------------------------------------------------------------------------------------------------------- | |
| | [Alternative](https://stackoverflow.com/questions/30009650/how-do-you-document-function-arguments) (`"alternative"`) | | | csharp | [Xmldoc](https://docs.microsoft.com/fr-fr/dotnet/csharp/language-reference/xmldoc/) (`"xmldoc"`) | |
| csharp | | | `func`, `file`, `class`| | | [Doxygen](https://www.doxygen.nl/manual/commands.html) (`"doxygen"`) | |
| | [Xmldoc](https://docs.microsoft.com/fr-fr/dotnet/csharp/language-reference/xmldoc/) (`"xmldoc"`) | `<summary>`, `<param>`,`<returns>`| | --------------- | ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| | [Doxygen](https://www.doxygen.nl/manual/commands.html) (`"doxygen"`) | `@param`, `@return`, `@brief`| | php | [Ph-doc](https://docs.phpdoc.org/3.0/guide/references/phpdoc/index.html) (`"phpdoc"`) | `@func`, `@type`, `@class` |
| php | | | `func`, `type`, `class` |
| | [Php-doc](https://docs.phpdoc.org/3.0/guide/references/phpdoc/index.html) (`"phpdoc"`) | `@var`, `@param`, `@return` |
## Adding Languages ## Adding Languages
@@ -226,11 +228,11 @@ There is a list of supported languages and fields, with their annotation style
![screen1](https://user-images.githubusercontent.com/5306901/135055052-6ee6a5e8-3f30-4c41-872e-e624e21a1e98.gif) ![screen1](https://user-images.githubusercontent.com/5306901/135055052-6ee6a5e8-3f30-4c41-872e-e624e21a1e98.gif)
![screen3](https://user-images.githubusercontent.com/5306901/135055174-2a9d8b88-7b23-4513-af91-135d885783ec.gif) ![screen3](https://user-images.githubusercontent.com/5306901/135055174-2a9d8b88-7b23-4513-af91-135d885783ec.gif)
![screen4](https://user-images.githubusercontent.com/5306901/135056308-9808c231-b1fd-4c41-80bd-85a08d7286dd.gif) ![screen4](https://user-images.githubusercontent.com/5306901/135056308-9808c231-b1fd-4c41-80bd-85a08d7286dd.gif)
## Credits ## Credits
- Binx, for making that gorgeous logo for free! - Binx, for making that gorgeous logo for free!
- [Github](https://github.com/Binx-Codes/) - [Github](https://github.com/Binx-Codes/)
- [Reddit](https://www.reddit.com/u/binxatmachine) - [Reddit](https://www.reddit.com/u/binxatmachine)