mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
refactor: old references to scripts/ dir #32647
This commit is contained in:
@@ -1,24 +1,23 @@
|
|||||||
--- Converts Nvim :help files to HTML. Validates |tag| links and document syntax (parser errors).
|
--- Converts Nvim :help files to HTML. Validates |tag| links and document syntax (parser errors).
|
||||||
--
|
--
|
||||||
-- USAGE (For CI/local testing purposes): Simply `make lintdoc` or `scripts/lintdoc.lua`, which
|
-- USAGE (For CI/local testing purposes): Simply `make lintdoc`, which basically does the following:
|
||||||
-- basically does the following:
|
|
||||||
-- 1. :helptags ALL
|
-- 1. :helptags ALL
|
||||||
-- 2. nvim -V1 -es +"lua require('scripts.gen_help_html').run_validate()" +q
|
-- 2. nvim -V1 -es +"lua require('src.gen.gen_help_html').run_validate()" +q
|
||||||
-- 3. nvim -V1 -es +"lua require('scripts.gen_help_html').test_gen()" +q
|
-- 3. nvim -V1 -es +"lua require('src.gen.gen_help_html').test_gen()" +q
|
||||||
--
|
--
|
||||||
-- USAGE (GENERATE HTML):
|
-- USAGE (GENERATE HTML):
|
||||||
-- 1. `:helptags ALL` first; this script depends on vim.fn.taglist().
|
-- 1. `:helptags ALL` first; this script depends on vim.fn.taglist().
|
||||||
-- 2. nvim -V1 -es --clean +"lua require('scripts.gen_help_html').gen('./runtime/doc', 'target/dir/')" +q
|
-- 2. nvim -V1 -es --clean +"lua require('src.gen.gen_help_html').gen('./runtime/doc', 'target/dir/')" +q
|
||||||
-- - Read the docstring at gen().
|
-- - Read the docstring at gen().
|
||||||
-- 3. cd target/dir/ && jekyll serve --host 0.0.0.0
|
-- 3. cd target/dir/ && jekyll serve --host 0.0.0.0
|
||||||
-- 4. Visit http://localhost:4000/…/help.txt.html
|
-- 4. Visit http://localhost:4000/…/help.txt.html
|
||||||
--
|
--
|
||||||
-- USAGE (VALIDATE):
|
-- USAGE (VALIDATE):
|
||||||
-- 1. nvim -V1 -es +"lua require('scripts.gen_help_html').validate('./runtime/doc')" +q
|
-- 1. nvim -V1 -es +"lua require('src.gen.gen_help_html').validate('./runtime/doc')" +q
|
||||||
-- - validate() is 10x faster than gen(), so it is used in CI.
|
-- - validate() is 10x faster than gen(), so it is used in CI.
|
||||||
--
|
--
|
||||||
-- SELF-TEST MODE:
|
-- SELF-TEST MODE:
|
||||||
-- 1. nvim -V1 -es +"lua require('scripts.gen_help_html')._test()" +q
|
-- 1. nvim -V1 -es +"lua require('src.gen.gen_help_html')._test()" +q
|
||||||
--
|
--
|
||||||
-- NOTES:
|
-- NOTES:
|
||||||
-- * This script is used by the automation repo: https://github.com/neovim/doc
|
-- * This script is used by the automation repo: https://github.com/neovim/doc
|
||||||
@@ -277,7 +276,7 @@ end
|
|||||||
|
|
||||||
--- Removes the common indent level, after expanding tabs to 8 spaces.
|
--- Removes the common indent level, after expanding tabs to 8 spaces.
|
||||||
local function trim_indent(s)
|
local function trim_indent(s)
|
||||||
return vim.text.indent(0, s, { expandtab = 8 })
|
return (vim.text.indent(0, s, { expandtab = 8 }))
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Gets raw buffer text in the node's range (+/- an offset), as a newline-delimited string.
|
--- Gets raw buffer text in the node's range (+/- an offset), as a newline-delimited string.
|
||||||
@@ -935,7 +934,7 @@ local function gen_one(fname, text, to_fname, old, commit, parser_path)
|
|||||||
<a name="%s" href="#%s"><h1 id="%s">%s</h1></a>
|
<a name="%s" href="#%s"><h1 id="%s">%s</h1></a>
|
||||||
<p>
|
<p>
|
||||||
<i>
|
<i>
|
||||||
Nvim <code>:help</code> pages, <a href="https://github.com/neovim/neovim/blob/master/scripts/gen_help_html.lua">generated</a>
|
Nvim <code>:help</code> pages, <a href="https://github.com/neovim/neovim/blob/master/src/gen/gen_help_html.lua">generated</a>
|
||||||
from <a href="https://github.com/neovim/neovim/blob/master/runtime/doc/%s">source</a>
|
from <a href="https://github.com/neovim/neovim/blob/master/runtime/doc/%s">source</a>
|
||||||
using the <a href="https://github.com/neovim/tree-sitter-vimdoc">tree-sitter-vimdoc</a> parser.
|
using the <a href="https://github.com/neovim/tree-sitter-vimdoc">tree-sitter-vimdoc</a> parser.
|
||||||
</i>
|
</i>
|
||||||
@@ -1449,7 +1448,7 @@ function M.run_validate(help_dir)
|
|||||||
eq(
|
eq(
|
||||||
{},
|
{},
|
||||||
rv.invalid_spelling,
|
rv.invalid_spelling,
|
||||||
'invalid spelling in :help docs (see spell_dict in scripts/gen_help_html.lua)'
|
'invalid spelling in :help docs (see spell_dict in src/gen/gen_help_html.lua)'
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user