summaryrefslogtreecommitdiff
path: root/scripts/gendocs.lua
blob: 0cf8a80014f4c5ac958236a7d83c0a338dfd56e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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