docs(gen_help_html): accept "~/" in file/dir params #24240

This commit is contained in:
Justin M. Keyes 2023-07-03 05:04:43 -07:00 committed by GitHub
parent 5f442e1a4a
commit 6da110d617
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1089,7 +1089,7 @@ end
--- @returns info dict --- @returns info dict
function M.gen(help_dir, to_dir, include, commit, parser_path) function M.gen(help_dir, to_dir, include, commit, parser_path)
vim.validate{ vim.validate{
help_dir={help_dir, function(d) return vim.fn.isdirectory(d) == 1 end, 'valid directory'}, help_dir={help_dir, function(d) return vim.fn.isdirectory(vim.fn.expand(d)) == 1 end, 'valid directory'},
to_dir={to_dir, 's'}, to_dir={to_dir, 's'},
include={include, 't', true}, include={include, 't', true},
commit={commit, 's', true}, commit={commit, 's', true},
@ -1098,8 +1098,9 @@ function M.gen(help_dir, to_dir, include, commit, parser_path)
local err_count = 0 local err_count = 0
ensure_runtimepath() ensure_runtimepath()
tagmap = get_helptags(help_dir) tagmap = get_helptags(vim.fn.expand(help_dir))
helpfiles = get_helpfiles(include) helpfiles = get_helpfiles(include)
to_dir = vim.fn.expand(to_dir)
parser_path = parser_path and vim.fn.expand(parser_path) or nil parser_path = parser_path and vim.fn.expand(parser_path) or nil
print(('output dir: %s'):format(to_dir)) print(('output dir: %s'):format(to_dir))
@ -1134,14 +1135,14 @@ end
-- @returns results dict -- @returns results dict
function M.validate(help_dir, include, parser_path) function M.validate(help_dir, include, parser_path)
vim.validate{ vim.validate{
help_dir={help_dir, function(d) return vim.fn.isdirectory(d) == 1 end, 'valid directory'}, help_dir={help_dir, function(d) return vim.fn.isdirectory(vim.fn.expand(d)) == 1 end, 'valid directory'},
include={include, 't', true}, include={include, 't', true},
parser_path={parser_path, function(f) return f == nil or vim.fn.filereadable(vim.fn.expand(f)) == 1 end, 'valid vimdoc.{so,dll} filepath'}, parser_path={parser_path, function(f) return f == nil or vim.fn.filereadable(vim.fn.expand(f)) == 1 end, 'valid vimdoc.{so,dll} filepath'},
} }
local err_count = 0 local err_count = 0
local files_to_errors = {} local files_to_errors = {}
ensure_runtimepath() ensure_runtimepath()
tagmap = get_helptags(help_dir) tagmap = get_helptags(vim.fn.expand(help_dir))
helpfiles = get_helpfiles(include) helpfiles = get_helpfiles(include)
parser_path = parser_path and vim.fn.expand(parser_path) or nil parser_path = parser_path and vim.fn.expand(parser_path) or nil