Skip to content

Commit

Permalink
fix(docgen): make the wiki work again
Browse files Browse the repository at this point in the history
  • Loading branch information
vhyrro committed Jan 7, 2024
1 parent 221bb2e commit d44dd38
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
21 changes: 14 additions & 7 deletions docgen/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,28 @@ for _, file in ipairs(docgen.aggregate_module_files()) do
local ok, parsed_module = pcall(dofile, fullpath)

if not ok then
vim.notify("Error when sourcing module '" .. file .. ": " .. parsed_module)
vim.notify("Error when sourcing module '" .. file .. "': " .. parsed_module)
goto continue
end

-- Make Neorg load the module, which also evaluates dependencies
modules.load_module(parsed_module.name)
local _ok, err = pcall(modules.load_module, parsed_module.name)

if not _ok then
vim.notify("Error when loading module '" .. file .. "': " .. err)
goto continue
end

-- Retrieve the module from the `loaded_modules` table.
parsed_module = modules.loaded_modules[parsed_module.name]

doc_modules[parsed_module.name] = {
top_comment_data = top_comment_data,
buffer = buffer,
parsed = parsed_module,
}
if parsed_module then
doc_modules[parsed_module.name] = {
top_comment_data = top_comment_data,
buffer = buffer,
parsed = parsed_module,
}
end

::continue::
end
Expand Down
2 changes: 1 addition & 1 deletion docgen/minimal_init.vim
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ package.path = "../nvim-treesitter/lua/?.lua;" .. package.path

vim.cmd.TSInstallSync({
bang = true,
args = { "lua" },
args = { "lua", "norg" },
})
EOF

0 comments on commit d44dd38

Please sign in to comment.