-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
49 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
MINIMAL_INIT := ./scripts/minimal_init.vim | ||
DOC_GEN_SCRIPT := ./scripts/docs.lua | ||
PLUGIN_DIR := lua/ | ||
|
||
|
||
test: | ||
nvim --headless --noplugin -u ${MINIMAL_INIT} \ | ||
-c "PlenaryBustedDirectory lua/ { minimal_init = '${MINIMAL_INIT}' }" | ||
-c "PlenaryBustedDirectory ${PLUGIN_DIR} { minimal_init = '${MINIMAL_INIT}' }" | ||
|
||
docs: | ||
nvim --headless --noplugin -u ${MINIMAL_INIT} \ | ||
-c "luafile ${DOC_GEN_SCRIPT}" -c 'qa' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
local docgen = require "docgen" | ||
|
||
local docs = {} | ||
|
||
docs.test = function() | ||
-- Filepaths that should generate docs | ||
local input_files = { | ||
"./lua/unclutter/init.lua", | ||
"./lua/unclutter/config.lua", | ||
} | ||
|
||
-- Maybe sort them that depends what you want and need | ||
table.sort(input_files, function(a, b) | ||
return #a < #b | ||
end) | ||
|
||
-- Output file | ||
local output_file = "./doc/unclutter.txt" | ||
local output_file_handle = io.open(output_file, "w") | ||
assert(output_file_handle, "Could not open " .. output_file) | ||
|
||
for _, input_file in ipairs(input_files) do | ||
docgen.write(input_file, output_file_handle) | ||
end | ||
|
||
output_file_handle:write " vim:tw=78:ts=8:ft=help:norl:\n" | ||
output_file_handle:close() | ||
vim.cmd [[checktime]] | ||
end | ||
|
||
docs.test() | ||
|
||
return docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,13 @@ | ||
let plenary_path = stdpath('data') . '/lazy/plenary.nvim/' | ||
execute 'set rtp+=' . plenary_path | ||
let plugins_path = stdpath('data') . '/lazy' | ||
|
||
set rtp+=. | ||
" for tests | ||
execute 'set rtp+=' . plugins_path . '/plenary.nvim/' | ||
" for docs generation | ||
execute 'set rtp+=' . plugins_path . '/tree-sitter-lua/' | ||
|
||
|
||
runtime! plugin/plenary.vim | ||
runtime! plugin/unclutter.lua | ||
runtime! plugin/ts_lua.lua | ||
|