summaryrefslogtreecommitdiff
path: root/scripts/gendocs.lua
diff options
context:
space:
mode:
authorTJ DeVries <devries.timothyj@gmail.com>2021-02-24 21:44:51 -0500
committerGitHub <noreply@github.com>2021-02-24 21:44:51 -0500
commit55ab5c77a54e0545eb09f4076ac0f2408752674c (patch)
tree6bbe3903083f35f587d4b7eb804cf2d2763c44f5 /scripts/gendocs.lua
parent8b3d08d7a6e8eccc2997ccbf91a7e12d506196e5 (diff)
feat: Add vim docs & generators (#370)
* feat: Add vim docs & generators * example of what we could start to do * Docgen CI job * wip * incremental updates. soon good validation * [Actions] Generate Documentation skip-checks: true * pretty cool now * [Actions] Generate Documentation skip-checks: true * make sure telescope is loaded first * Add updates. Maybe this will not delete now? * Add defaults tags as well * :smile: Co-authored-by: Simon Hauser <Simon-Hauser@outlook.de> Co-authored-by: Github Actions <actions@github>
Diffstat (limited to 'scripts/gendocs.lua')
-rw-r--r--scripts/gendocs.lua34
1 files changed, 34 insertions, 0 deletions
diff --git a/scripts/gendocs.lua b/scripts/gendocs.lua
new file mode 100644
index 0000000..0cf8a80
--- /dev/null
+++ b/scripts/gendocs.lua
@@ -0,0 +1,34 @@
+-- Setup telescope with defaults
+require('telescope').setup()
+
+local docgen = require('docgen')
+
+local docs = {}
+
+docs.test = function()
+ -- TODO: Fix the other files so that we can add them here.
+ local input_files = {
+ "./lua/telescope/init.lua",
+ "./lua/telescope/builtin/init.lua",
+ "./lua/telescope/pickers/layout_strategies.lua",
+ }
+
+ table.sort(input_files, function(a, b)
+ return #a < #b
+ end)
+
+ local output_file = "./doc/telescope.txt"
+ local output_file_handle = io.open(output_file, "w")
+
+ 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