kkoomen / vim-doge

(Do)cumentation (Ge)nerator for nearly 20 languages 📚 Generate proper code documentation with a single keypress. ⚡️🔥
GNU General Public License v3.0
1.01k stars 49 forks source link

Add support for custom doc standards #654

Open sforli opened 8 months ago

sforli commented 8 months ago

Is your feature request related to a problem? Please describe. As far as the documentation goes, it does not seem possible to specify a custom doc format.

Describe the solution you'd like It would be great if there was a way to specify a path to a custom YAML file to be used to generate the doc strings. Likely, that should be done on a per filetype basis.

This could be done at different levels. The simplest approach would be to specify a single file template for a filetype, e.g.:

let g:doge_doc_standard_python_custom = '/path/my_python_template.yml'

Alternatively, if the existing code would allow it without too much refactoring, a dictionary could be specified:

let g:doge_doc_standard_custom = { "cpp" : "/path/my_cpp.yml",
                                                           \ "python" : "/path/my_python.yml",
                                                           \ "rust" : "/path/my_rust.yml",
                                                          \ }

Describe alternatives you've considered Other similar projects like vim-pydocstring have such functionality, where users can specify a path containing one or more custom styles. While this project is limited to Python code, I don't think it should be too difficult to provide the same while supporting multiple languages.

Additional context N/A

kkoomen commented 8 months ago

Hi,

In v1-v2 we added this support through vimscript but deleted it in v3 as it became troublesome to implement through vimscript for users. The rewrite v4 does allow more flexibility for this feature as template are implemented through yaml instead of vimscript, so I will reconsider it, although it will take quite some time for me to work on this, as I'm quite busy recently.