aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2022-10-14 11:01:13 -0400
committerGitHub <noreply@github.com>2022-10-14 08:01:13 -0700
commite5cb3104d07228de4f2614c425355e8f2f99507d (patch)
tree919827f5a8665874a166a6a6a3c5540e7d087c3a /scripts
parent0a19c1677877843d50cea6dec150acde50df356c (diff)
downloadrneovim-e5cb3104d07228de4f2614c425355e8f2f99507d.tar.gz
rneovim-e5cb3104d07228de4f2614c425355e8f2f99507d.tar.bz2
rneovim-e5cb3104d07228de4f2614c425355e8f2f99507d.zip
docs: fix/remove invalid URLs #20647
Diffstat (limited to 'scripts')
-rw-r--r--scripts/gen_help_html.lua14
-rwxr-xr-xscripts/gen_vimdoc.py11
2 files changed, 14 insertions, 11 deletions
diff --git a/scripts/gen_help_html.lua b/scripts/gen_help_html.lua
index 06ea1831b0..39c516ee96 100644
--- a/scripts/gen_help_html.lua
+++ b/scripts/gen_help_html.lua
@@ -319,6 +319,16 @@ local function validate_link(node, bufnr, fname)
return helppage, tagname, ignored
end
+local function validate_url(text, fname)
+ local ignored = false
+ if vim.fs.basename(fname) == 'pi_netrw.txt' then
+ ignored = true
+ elseif text:find('http%:') then
+ invalid_urls[text] = vim.fs.basename(fname)
+ end
+ return ignored
+end
+
-- Traverses the tree at `root` and checks that |tag| links point to valid helptags.
local function visit_validate(root, level, lang_tree, opt, stats)
level = level or 0
@@ -353,9 +363,7 @@ local function visit_validate(root, level, lang_tree, opt, stats)
end
end
elseif node_name == 'url' then
- if text:find('http%:') then
- invalid_urls[text] = vim.fs.basename(opt.fname)
- end
+ validate_url(text, opt.fname)
elseif node_name == 'taglink' or node_name == 'optionlink' then
local _, _, _ = validate_link(root, opt.buf, opt.fname)
end
diff --git a/scripts/gen_vimdoc.py b/scripts/gen_vimdoc.py
index 3ee9d8b5dd..a044c8c39d 100755
--- a/scripts/gen_vimdoc.py
+++ b/scripts/gen_vimdoc.py
@@ -12,15 +12,10 @@ Flow:
update_params_map /
render_node
-This would be easier using lxml and XSLT, but:
+TODO: eliminate this script and use Lua+treesitter (requires parsers for C and
+Lua markdown-style docstrings).
- 1. This should avoid needing Python dependencies, especially ones that are
- C modules that have library dependencies (lxml requires libxml and
- libxslt).
- 2. I wouldn't know how to deal with nested indentation in <para> tags using
- XSLT.
-
-Each function :help block is formatted as follows:
+The generated :help text for each function is formatted as follows:
- Max width of 78 columns (`text_width`).
- Indent with spaces (not tabs).