All Projects β†’ kkoomen β†’ Vim Doge

kkoomen / Vim Doge

Licence: gpl-3.0
(Do)cumentation (Ge)nerator 10+ languages πŸ“š Generate proper code documentation skeletons with a single keypress. ⚑️πŸ”₯

Programming Languages

languages
34 projects

Projects that are alternatives of or similar to Vim Doge

Express Typescript Boilerplate
A delightful way to building a RESTful API with NodeJs & TypeScript by @w3tecch
Stars: ✭ 2,293 (+330.21%)
Mutual labels:  documentation, boilerplate, skeleton
Pollinate
Template your base files and generate new projects from Git(Hub).
Stars: ✭ 213 (-60.04%)
Mutual labels:  boilerplate, generator, skeleton
Reactprimer
React component prototyping tool that generates fully connected class component code.
Stars: ✭ 743 (+39.4%)
Mutual labels:  boilerplate, generator, skeleton
Typedoc
Documentation generator for TypeScript projects.
Stars: ✭ 5,377 (+908.82%)
Mutual labels:  documentation, generator
Cgx
πŸ’»πŸ”₯CLI to generate the recommended documentation/files to improve contribution (Github, Gitlab, CodeCommit and Bitbucket)
Stars: ✭ 190 (-64.35%)
Mutual labels:  documentation, generator
Electron Vue
An Electron & Vue.js quick start boilerplate with vue-cli scaffolding, common Vue plugins, electron-packager/electron-builder, unit/e2e testing, vue-devtools, and webpack.
Stars: ✭ 14,610 (+2641.09%)
Mutual labels:  documentation, boilerplate
Sourcedocs
Generate Markdown documentation from source code
Stars: ✭ 286 (-46.34%)
Mutual labels:  documentation, generator
Generator
Use your AsyncAPI definition to generate literally anything. Markdown documentation, Node.js code, HTML documentation, anything!
Stars: ✭ 237 (-55.53%)
Mutual labels:  documentation, generator
Project Stub
deps
Stars: ✭ 300 (-43.71%)
Mutual labels:  boilerplate, skeleton
Webpack Boilerplate
A minimal webpack 5 boilerplate with only Babel, SASS and lodash (optional) on board
Stars: ✭ 404 (-24.2%)
Mutual labels:  boilerplate, skeleton
Dokz
Effortless documentation with Next.js and MDX
Stars: ✭ 353 (-33.77%)
Mutual labels:  documentation, generator
Assemble
Community
Stars: ✭ 3,995 (+649.53%)
Mutual labels:  documentation, generator
Apigen
PHP 7.1 ready Smart and Simple Documentation for your PHP project
Stars: ✭ 2,068 (+287.99%)
Mutual labels:  documentation, generator
Terraform Docs
Generate documentation from Terraform modules in various output formats
Stars: ✭ 2,483 (+365.85%)
Mutual labels:  documentation, generator
Yii2 Apidoc
Yii 2 apidoc extension.
Stars: ✭ 236 (-55.72%)
Mutual labels:  documentation, generator
Dot Hugo Documentation Theme
Dot - Hugo Documentation Theme
Stars: ✭ 162 (-69.61%)
Mutual labels:  documentation, fast
Hackman
πŸ€–πŸ”œπŸ€― Stop writing boilerplate code yourself. Let hackman do it for you via the command line.
Stars: ✭ 286 (-46.34%)
Mutual labels:  boilerplate, generator
Verb
HEADS UP! Verb is going though a major transition, we've completely refactored everything from the ground up. If you're interested, please see the dev branch.
Stars: ✭ 442 (-17.07%)
Mutual labels:  documentation, generator
Easy Doc Bundle
Symfony application documentation generator
Stars: ✭ 99 (-81.43%)
Mutual labels:  documentation, generator
Generator Standard Readme
Scaffold out a Standard Readme
Stars: ✭ 150 (-71.86%)
Mutual labels:  documentation, generator

DoGe

tests build status Minimum supported Vim version Minimum supported NeoVim version Latest version License Chat on Gitter

Any fool can write code that a computer can understand. Good programmers write code that humans can understand. -- Martin Fowler, 1999

We all love documentation because it makes our codebases easier to understand, yet no one has time to write it in a good and proper way.

DoGe is a (Do)cumentation (Ge)nerator which will generate a proper documentation skeleton based on certain expressions (mainly functions). Simply put your cursor on a function, press <Leader>d, jump quickly through TODO items using <Tab> and <S-Tab> to quickly add descriptions and go on coding!

Visit the demo page

Table of Contents

Supported languages and doc standards

Every language that has a documentation standard should be supported by DoGe.

Is your favorite language not supported? Suggest a new language πŸŽ‰
Is your favorite doc standard not supported? Suggest a new doc standard πŸŽ‰

Language Doc standards
βœ… Python reST, Numpy, Google, Sphinx
βœ… PHP phpdoc
βœ… JavaScript (Including: ES6, FlowJS and NodeJS) JSDoc
βœ… TypeScript JSDoc
βœ… Lua LDoc
βœ… Java JavaDoc
βœ… Groovy JavaDoc
βœ… Ruby YARD
βœ… C++ Doxygen
βœ… C Doxygen, KernelDoc
βœ… Bash Google
βœ… Rust RustDoc

Getting started

Using plug:

  • Plug 'kkoomen/vim-doge', { 'do': { -> doge#install() } }

Using vim-pack:

  • git clone --recursive --depth 1 https://github.com/kkoomen/vim-doge ~/.vim/pack/*/start/vim-doge
  • Open Vim and run :call doge#install()

Using Pathogen:

  • git clone --recursive --depth 1 https://github.com/kkoomen/vim-doge ~/.vim/bundle/vim-doge
  • Open Vim and run :call doge#install()

Using Vundle:

  • Plugin 'kkoomen/vim-doge'
  • Open Vim and run :call doge#install()

Configuration

Run :help doge to get the full help page.

Choosing a different doc standard

DoGe supports multiple doc standard and you can overwrite them per filetype in your vimrc. Is your favorite doc standard not supported? Suggest a new doc standard πŸŽ‰

Example:

let g:doge_doc_standard_python = 'numpy'

If you want to change the doc standard specifically for a buffer, then you can do:

" Inside test.py
:let b:doge_doc_standard = 'numpy'

If you want to generate a docblock using a different doc standard just for a specific expression, then you can use DogeGenerate:

" Inside test.py, cursor is at a function expression (cursor = `|`):
"   |def foo(p1, p2):
"       pass
:DogeGenerate numpy

Here is the full list of available doc standards per filetype:

Variable Default Supported
g:doge_doc_standard_python 'reST' 'reST', 'numpy', 'google', 'sphinx'
g:doge_doc_standard_php 'phpdoc' 'phpdoc'
g:doge_doc_standard_javascript 'jsdoc' 'jsdoc'
g:doge_doc_standard_typescript 'jsdoc' 'jsdoc'
g:doge_doc_standard_lua 'ldoc' 'ldoc'
g:doge_doc_standard_java 'javadoc' 'javadoc'
g:doge_doc_standard_groovy 'javadoc' 'javadoc'
g:doge_doc_standard_ruby 'YARD' 'YARD'
g:doge_doc_standard_cpp 'doxygen_javadoc' 'doxygen_javadoc', 'doxygen_javadoc_no_asterisk', 'doxygen_javadoc_banner', 'doxygen_qt', 'doxygen_qt_no_asterisk'
g:doge_doc_standard_c 'doxygen_javadoc' 'kernel_doc', 'doxygen_javadoc', 'doxygen_javadoc_no_asterisk', 'doxygen_javadoc_banner', 'doxygen_qt', 'doxygen_qt_no_asterisk'
g:doge_doc_standard_sh 'google' 'google'
g:doge_doc_standard_rs 'rustdoc' 'rustdoc'

Options

g:doge_enable_mappings

Default: 1

Whether or not to enable built-in mappings.

g:doge_mapping

Default: '<Leader>d'

The mapping to trigger DoGe. The mapping accepts a count, to select a specific doc standard, if more than one is defined.

g:doge_filetype_aliases

Default:

{
  'javascript': [
    'javascript.jsx',
    'javascriptreact',
    'javascript.tsx',
    'typescriptreact',
    'typescript',
    'typescript.tsx',
  ],
  'java': ['groovy'],
}

Set filetypes as an alias for other filetypes. The key should be the filetype that is defined in ftplugin/<filetype>.vim. The value must be a list of 1 or more filetypes that will be aliases.

Example:

let g:doge_filetype_aliases = {
\  'javascript': ['vue']
\}

If you use the above settings and you open myfile.vue then it will behave like you're opening a JavaScript filetype.

g:doge_buffer_mappings

Default: 1

Mappings to jump forward/backward are applied as buffer mappings when interactive mode starts and removed when it ends.

g:doge_mapping_comment_jump_forward

Default: '<Tab>'

The mapping to jump forward to the next TODO item in a comment. Requires g:doge_comment_interactive to be enabled.

g:doge_mapping_comment_jump_backward

Default: '<S-Tab>'

The mapping to jump backward to the previous TODO item in a comment. Requires g:doge_comment_interactive to be enabled.

g:doge_comment_interactive

Default: 1

Jumps interactively through all TODO items in the generated comment.

g:doge_comment_jump_wrap

Default: 1

Continue to cycle among placeholders when reaching the start or end.

g:doge_comment_jump_modes

Default: ['n', 'i', 's']

Defines the modes in which doge will jump forward and backward when interactive mode is active. For example: removing i would allow you to use <Tab> for autocompletion in insert mode.

Commands

:DogeGenerate {doc_standard}

Command to generate documentation. The {doc_standard} accepts a count or a string as argument, and it can complete the available doc standards for the current buffer.

The numeric value should point to an index key from the b:doge_supported_doc_standards variable.

The string value should point to a doc standard name listed in the b:doge_supported_doc_standards variable.

:DogeCreateDocStandard {doc_standard}

Command to generate a custom doc standard template. The {doc_standard} is a mandatory argument which is the name of the new doc standard. If it exists, the existing doc standard with the same name will be used as base for the custom template. It can complete the available doc standards for the current buffer.

For more information on how to create custom doc standards you can read Writing your first pattern.

Language-specific configuration

Below is a list of language-specific configuration and their default values.

JavaScript

JavaScript settings automatically apply for all the default filetypes that are being aliased, see g:doge_filetype_aliases.

let g:doge_javascript_settings = {
\  'destructuring_props': 1,
\}
  • destructuring_props: Whether or not to generate @param tags for the destructured properties in a function expression.

PHP

let g:doge_php_settings = {
\  'resolve_fqn': 1
\}
  • resolve_fqn: Whether or not to resolve the FQN based on the use statements in the current buffer. The FQN will be resolved for type hints in parameters and the return type.

Python

let g:doge_python_settings = {
\  'single_quotes': 0
\}
  • single_quotes: Whether or not to use single quotes for the multi-line comments openers and closers

Headless mode

If you're running your vim commands inside a docker, CI or similar environments with commands such as vim +PlugInstall +qall > /dev/null then you probably want to use headless mode. This will not spawn any terminals, progress bars etc and will simply run any process by vim-doge in the background.

This feature can be enabled by passing in { 'headless': 1 } into the doge#install() like so: doge#install({ 'headless': 1 }).

Example using vim-plug:

Plug 'kkoomen/vim-doge', {'do': { -> doge#install({ 'headless': 1 }) }}

Help

To open all the help pages, run :help doge.

Contributing

Help or feedback is always appreciated. If you find any bugs, feel free to submit a bug report. If you think DoGe can be improved, feel free to submit a feature request or a pull request if you have time to help out.

Read the Contribution Guidelines and Code of Conduct when doing contributions.

Tree sitter

If you want a new language to be supported but tree-sitter doesn't support it yet, then feel free to create a custom tree-sitter language parser for that language and then we'll integrate it into vim-doge.

Motivation

I created DoGe mainly because I couldn't find a plugin that could generate proper comments for a big collection of languages in a quick and easy way. I am a polyglot developer when it comes to programming languages and I couldn't find proper vim plugins that would generate documentation quickly for all languages I did want to be supported.

Rather then scraping off the internet to find all sorts of vim plugins for every language I was coding in, I did want a single plugin that would support every language I was working in.

Another big motivation for me is that I've noticed people tend to skip the documentation part because writing just the skeleton of the comment takes already too much time and I am one of those people. Having the skeleton generated and an interactive mode to quickly add descriptions is a big time saver.

Supporting DoGe

Do you enjoy using DoGe? Give it a star on GitHub and submit your vote on vim.org.

License

DoGe is licensed under the GPL-3.0 license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].