Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(gen_help_html.lua): adapt to new parser #20352

Merged
merged 3 commits into from
Sep 28, 2022
Merged

Conversation

justinmk
Copy link
Member

@justinmk justinmk commented Sep 26, 2022

ref #11967

image

- Separate blocks (paragraphs) of content by a blank line(s).
- Do not use indentation in random places—that prevents the page from using
"flow" layout. If you need a preformatted section, put it in
a |help-codeblock| starting with ">".
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some doc guidelines for optimal formatting.



- `ext_cmdline` Externalize the cmdline. |ui-cmdline|
- `ext_hlstate` Detailed highlight state. |ui-hlstate|
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use lists to list things... otherwise we are stuck with "hardwrap" / preformatted format.

exec_lua('return vim.inspect(...)', rv.invalid_tags))
-- TODO: Fix all parse errors in :help files.
ok(rv.err_count < 1300, '<1300 parse errors', rv.err_count)
eq({}, rv.invalid_links, exec_lua([[return 'found invalid :help tag links:\n'..vim.inspect(...)]], rv.invalid_links))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

invalid links are now at zero, so we can be strict here

ok(exec_lua('return vim.tbl_count(...)', rv.invalid_tags) < 538, '<538',
exec_lua('return vim.inspect(...)', rv.invalid_tags))
-- TODO: Fix all parse errors in :help files.
ok(rv.err_count < 1300, '<1300 parse errors', rv.err_count)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parse errors reduced from 24k to ~1k

NeoVim = 'Nvim',
neovim = 'Nvim',
lua = 'Lua',
}
Copy link
Member Author

@justinmk justinmk Sep 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

experimenting with other lint stuff here (TODO: obviously scripts/gen_help_html.lua is not really the place for "linting", will eventually revisit this)

@justinmk justinmk force-pushed the genhtml branch 2 times, most recently from 83f7ed4 to 5ebb282 Compare September 28, 2022 15:25
- adapt to parser changes from neovim/tree-sitter-vimdoc#16
- numerous other generator improvements
XDG_STATE_HOME='$XDG_CONFIG_HOME',
XDG_DATA_DIRS='$XDG_CONFIG_DIRS',
clear({
args_rm={'runtimepath'},
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and in startup_spec.lua, remove the set runtimepath^=./build/lib/nvim/ added in this PR (which is necessary to find parsers not installed on the system).

@justinmk justinmk merged commit 268bad4 into neovim:master Sep 28, 2022
@justinmk justinmk deleted the genhtml branch September 28, 2022 16:55
justinmk added a commit to neovim/doc that referenced this pull request Sep 28, 2022
Problem:
The HTML :help docs generated by the new `gen_help_html.lua` do not
mention the source commit-id in the footer.

Solution:
Since neovim/neovim#20352 the script now
accepts a commit-id, so pass it.
justinmk added a commit to neovim/doc that referenced this pull request Sep 28, 2022
Problem:
The HTML :help docs generated by the new `gen_help_html.lua` do not
mention the source commit-id in the footer.

Solution:
Since neovim/neovim#20352 the script now
accepts a commit-id, so pass it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant