Generate and open your HTML code documentation inside Neovim.
Because the easier it is for you to access you code documentation, the more likely you are to use it. And with this plugin you have it one keypress away.
html
documentation, and open it on your internet browser. Depending the language it will use doxygen
, typedoc
, jsdoc
, rustdoc
, godoc
, ldoc
, or yard
.Language | Generator |
---|---|
c |
doxygen |
c++ |
doxygen |
c# |
doxygen |
objective-c |
doxygen |
java |
doxygen |
python |
doxygen |
php |
doxygen |
typescript |
typedoc |
javascript |
jsdoc |
rust |
rustdoc |
go |
godoc |
lua |
ldoc |
ruby |
yard |
# Pacman is the arch linux package manager.
# Use the equivalent command of your distro.
sudo pacman -S git doxygen rust go ldoc ruby-yard
npm install -g typedoc jdoc
go install golang.org/x/tools/cmd/godoc@latest
Then run :checkhealth dooku
to check if everything is OK.
lazy.nvim
{
"Zeioth/dooku.nvim",
event = "VeryLazy",
opts = {
-- your config options here
},
},
Command | Description |
---|---|
:DookuAutoSetup |
It will download a config file in your project root directory, so you can run :DookuGenerate without having to configure anything. Not necessary for rust and go . |
:DookuGenerate |
Generate the HTML documentation using the adecuated generator for the current filetype. |
:DookuOpen |
Open the HTML documentation using the specified program, or the default internet browser. |
project_root = { '.git', '.hg', '.svn', '.bzr', '_darcs', '_FOSSIL_', '.fslckout' } -- when one of these files is found, consider that directory the project root. Search starts upwards from the current buffer.
browser_cmd = "xdg-open" -- write your internet browser here. If unset, it will attempt to detect it automatically.
-- automations
on_bufwrite_generate = false -- auto run :DookuGenerate when a buffer is written.
on_generate_open = true -- auto open when running :DookuGenerate. This options is not triggered by on_bufwrite_generate.
auto_setup = true -- auto download a config for the generator if it doesn't exist in the project.
-- notifications
on_generate_notification = true
on_open_notification = true
vim.g.dooku_config
Run the commands in this order
:DookuAutoSetup
:DookuGenerate
:DookuOpen
Or if you prefer run :DookuGenerate
three times. This is only necessary the first time.
project_root
in your project root directory, or dooku.nvim might end up on the wrong directory silently.rust / go
you must initialize your project with cargo new your_project_name
or go mod init your_module_name
. Also ensure the generated Cargo.toml
or go.mod
are in the same dir as the project_root
. Also ensure the main directory of the project has the same name as the main module.lua
, make sure you can run ldoc .
in your project directory. ldoc
can refuse to generate the docs if they are formatted incorrectly, so go and see what's going on.backends
directory, copy the file doxygen.lua
, and and use it as base to add your new documentation generator. On options.lua
, copy all the doxygen specific options, and rename them to the language you are adding. Finally, on utils.lua
, add your language to the function get_backends
so your backend is recognized and loaded. Don't forget to send your PR so everyone can benefit from it!