Skip to content

Commit

Permalink
docs: update CONTRIBUTING.md and general documentation (#1098)
Browse files Browse the repository at this point in the history
Co-authored-by: max397574 <[email protected]>
Co-authored-by: vhyrro <[email protected]>
  • Loading branch information
3 people authored Oct 4, 2023
1 parent 745715c commit 40b0955
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
8 changes: 2 additions & 6 deletions docgen/docgen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -595,17 +595,15 @@ docgen.render = function(configuration_option, open)
"* <details" .. (open and " open>" or ">"),
"",
((self.data.name or ""):match("^%s*$") and "<summary>" or table.concat({
"<summary><code>",
"<summary><h6><code>",
self.data.name,
"</code>",
"</h6></code>",
})) .. " (" .. type_of_object .. ")</summary>",
"",
}

if not vim.tbl_isempty(self.comments) then
vim.list_extend(basis, {
"<h6>",
"",
"<div>",
"",
})
Expand All @@ -615,8 +613,6 @@ docgen.render = function(configuration_option, open)
"",
"</div>",
"",
"</h6>",
"",
})
else
vim.list_extend(basis, {
Expand Down
11 changes: 10 additions & 1 deletion docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Whilst any help is very special, please be considerate of certain rules in order
- [Formatting rules](#formatting-rules)
- [Coding style](#coding-style)
- [Adding extra functionality](#adding-functionality)
- [Helping with documentation](#helping-with-documentation)
---

### Reporting a bug or issue
Expand All @@ -36,7 +37,7 @@ You can then run `make format` in the project root to automatically format all y

### Coding style
- I use snake_case for everything, and you should too :P
- **Please** comment all your code! Documentation for functions is generated by [neogen](https://github.com/danymat/neogen).
- **Please** comment all your code! Annotations for functions are generated by [neogen](https://github.com/danymat/neogen).

<!--### Modules
- When creating a module, add a comment up top as seen [here](/lua/neorg/modules/core/autocommands/module.lua) and [here](/lua/neorg/modules/core/keybinds/module.lua)
Expand All @@ -48,3 +49,11 @@ TODO: Make this reference our new "top comment" style.
## Adding functionality
Whenever you are planning on extending neorg, try your best to add *all* extra functionality through modules and modules only. Make changes to the Neorg core only if absolutely necessary.
When adding stuff, use lua only. `vim.cmd` in extreme cases :)

## Helping with documentation
The documentations (wiki pages) are generated based on the comments in the code. All the logic for generating the wiki is in [`docgen/`](../docgen/).
To generate documentations locally, run `make local-documentation` (see [`Makefile`](../Makefile) for more details). If there's no error, you should then see a `wiki/` folder generated.

If you feel like improving the documentation, please make changes to the corresponding comments in the correct file. For example, to make changes to the `core.qol.todo_items` documentation, please make changes to the comments in [`./lua/neorg/modules/core/qol/todo_items/module.lua`](../lua/neorg/modules/core/qol/todo_items/module.lua)

> Tips: `grep` for the string you want to find.
6 changes: 5 additions & 1 deletion lua/neorg/modules/core/qol/todo_items/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ The following keybinds are exposed:
With your cursor on a line that contains an item with a TODO attribute, press
any of the above keys to toggle the state of that particular item.
Parent items of the same type and children items of the same type are update accordingly.
## Changing Keybinds
Please refer to the [`core.keybinds`](https://github.com/nvim-neorg/neorg/wiki/User-Keybinds#setting-up-a-keybind-hook) module
--]]

local neorg = require("neorg.core")
Expand Down Expand Up @@ -96,7 +99,7 @@ module.config.public = {
-- - Test Item
-- ```
-- With this option set to true, performing an operation (like pressing `<C-space>`
-- or `gtu` or what have you) will convert the non-todo item into one:
-- or what have you) will convert the non-todo item into one:
-- ```norg
-- - ( ) Test Item
-- ```
Expand Down Expand Up @@ -466,3 +469,4 @@ module.events.subscribed = {
}

return module

0 comments on commit 40b0955

Please sign in to comment.