aboutsummaryrefslogtreecommitdiff
path: root/scripts/gen_help_html.lua
Commit message (Collapse)AuthorAge
* docs: improve/add documentation of Lua typesLewis Russell2024-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added `@inlinedoc` so single use Lua types can be inlined into the functions docs. E.g. ```lua --- @class myopts --- @inlinedoc --- --- Documentation for some field --- @field somefield integer --- @param opts myOpts function foo(opts) end ``` Will be rendered as ``` foo(opts) Parameters: - {opts} (table) Object with the fields: - somefield (integer) Documentation for some field ``` - Marked many classes with with `@nodoc` or `(private)`. We can eventually introduce these when we want to.
* fix(gen_help_html): type warnings, spell_ignore_files #27254Jongwook Choi2024-01-29
| | | | | - Add type annotations, fix most of the type warnings. - Fix a minor bug on `spell_ignore_files`: nil error when an invalid spelling is found but the file is not ignored.
* docs: enforce "treesitter" spelling #27110Jongwook Choi2024-01-28
| | | It's the "tree-sitter" project, but "treesitter" in our code and docs.
* build(docs): separate lint job to validate vimdoc #27227Jongwook Choi2024-01-28
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Separate the lint job (`make lintdoc`) to validate runtime/doc, it is no longer as a part of functionaltest (help_spec). Build (cmake) and CI: - `make lintdoc`: validate vimdoc files and test-generate HTML docs. CI will run this as a part of the "docs" workflow. - `scripts/lintdoc.lua` is added as an entry point (executable script) for validating vimdoc files. scripts/gen_help_html.lua: - Move the tests for validating docs and generating HTMLs from `help_spec.lua` to `gen_help_html`. Added: - `gen_help_html.run_validate()`. - `gen_help_html.test_gen()`. - Do not hard-code `help_dir` to `build/runtime/doc`, but resolve from `$VIMRUNTIME`. Therefore, the `make lintdoc` job will check doc files on `./runtime/doc`, not on `./build/runtime/doc`. - Add type annotations for gen_help_html.
* fix(lua): return after assert returns assert message (#27064)altermo2024-01-17
|
* docs: convert BACKERS.md to backers.txtdundargoc2023-12-28
| | | | | | There is no reason for this file to be in project root, which is crowded as is. This also fits nicely part of the ongoing work towards gathering as much of the documentation as possible into one place.
* docs: add wiki FAQ to the runtime documentation (#26539)dundargoc2023-12-13
| | | | | | Problem: Wiki contents are not discoverable and hard to maintain. Solution: Move FAQ to runtime docs. Co-authored-by: Christian Clason <c.clason@uni-graz.at>
* build: enable lintlua for scripts/ dir #26391Justin M. Keyes2023-12-04
| | | | | | | | | | | Problem: We don't enable stylua for many Lua scripts. Automating code-style is an important tool for reducing time spent on accidental (non-essential) complexity. Solution: - Enable lintlua for `scripts/` directory. - Specify `call_parentheses = "Input"`, we should allow kwargs-style function invocations.
* Revert "docs: adjust help-tag-right CSS for HTML" #26046Justin M. Keyes2023-11-14
| | | | | The style change is mostly a regression. Reverts #25858 d50274812b275edff58418b3d17868385599fc14
* docs: adjust help-tag-right CSS for HTML #25858rsynnest2023-11-14
|
* docs: small fixes (#25831)dundargoc2023-11-03
| | | Co-authored-by: Peter Aronoff <peter@aronoff.org>
* feat(gen_help_html): add anchors to help tags #25112Sergey Slipchenko2023-09-12
| | | | | Fixes #21911 Co-authored by: wispl
* docs: also change "vimL" and "viml" to "Vimscript" (#24414)zeertzjq2023-07-21
|
* fix(docs): match DocSearch style with site themeJustin M. Keyes2023-07-08
| | | | ref https://github.com/neovim/neovim.github.io/commit/2b4f9e47809c16743f7d31d0dc1f1e3c2f313a56
* docs(gen_help_html): accept "~/" in file/dir params #24240Justin M. Keyes2023-07-03
|
* fix(docs): ignore_invalid #24174Justin M. Keyes2023-06-27
| | | Regex bug in scripts/gen_help_html.lua:ignore_invalid()
* fix(docs): too much whitespace around <pre> blocks #24151Justin M. Keyes2023-06-25
| | | | | | | | | | | | | Problem: In the generated docs HTML there is too much whitespace before/after `<pre>` blocks. - In the old layout (fixed-width), all text in `.old-help-para` is formatted as `white-space:pre`. - In the new layout, when `<pre>` is at the end of a `<div>`, the margins of both are redundant, causing too much space. Solution: - In the old layout, always remove `<pre>` margin. - In the new layout, disable `<pre>` margin if it is the last child.
* fix(docs): vimdoc syntax errorsJustin M. Keyes2023-06-25
| | | | gen_help_html: truncate parse-error sample text
* test: spellcheck :help (vimdoc) files #24109Justin M. Keyes2023-06-22
| | | | | | | Enforce consistent terminology (defined in `gen_help_html.lua:spell_dict`) for common misspellings. This does not spellcheck English in general (perhaps a future TODO, though it may be noisy).
* feat(gen_help_html): ignore pi_netrw.txt errorsJustin M. Keyes2023-06-22
| | | | IDGAF about netrw
* feat(gen_help_html): non-default vimdoc.so parserJustin M. Keyes2023-06-22
| | | | Callers can specify a non-default vimdoc.so file path.
* docs: lsp, vim_diffJustin M. Keyes2023-06-22
| | | | | | | - quickstart - mark lsp.txt as `new_layout` - remove lsp-handler documentation for notifications: they don't have handlers because they don't have server responses.
* docs #24061Justin M. Keyes2023-06-19
| | | | | | | | | | | | | | - nvim requires rpc responses in reverse order. https://github.com/neovim/neovim/issues/19932 - NVIM_APPNAME: UIs normally should NOT set this. ref #23520 fix #24050 fix #23660 fix #23353 fix #23337 fix #22213 fix #19161 fix #18088 fix #20693
* docs(html): define anchors for search engine #23879Justin M. Keyes2023-06-02
| | | | | | | | | | | | | Problem: Selecting a search result from the Algolia Docsearch widget does not navigate to a page anchor. The docs HTML provides `<a name=…>` anchors _near_ the `<h1>`/`<h2>`/… headings, but Algolia Docsearch expects the anchors to be _defined on_ the headings. That's also "semantically" nicer. https://docsearch.algolia.com/docs/manage-your-crawls/ Solution: Set `id` on the heading element instead of placing `<a name=…>` nearby. related: 3913ebbfcde7 #23839
* docs(html): algolia docsearch #23839Justin M. Keyes2023-05-30
| | | | | | | | | Need to manually include this in the generated docs html because it doesn't use the website's (jekyll) layout template. Maintenance notes: https://github.com/neovim/neovim.github.io/#maintenance Related: https://github.com/neovim/neovim.github.io/commit/ce9aef12eb1c98135965e3a9c5c792bf9e506a76
* docs(html): right-align inline tags (#23403)Christian Clason2023-05-02
|
* feat(lua): vim.tbl_contains supports general tables and predicates (#23040)Christian Clason2023-04-14
| | | | | | | | | | | | * feat(lua): vim.tbl_contains supports general tables and predicates Problem: `vim.tbl_contains` only works for list-like tables (integer keys without gaps) and primitive values (in particular, not for nested tables). Solution: Rename `vim.tbl_contains` to `vim.list_contains` and add new `vim.tbl_contains` that works for general tables and optionally allows `value` to be a predicate function that is checked for every key.
* refactor(treesitter)!: rename help parser to vimdocChristian Clason2023-04-01
|
* docs: treesitter.add_directive, add_predicate #21206Ching Pei Yang2023-01-16
|
* docs(website): soft wrap code blocks #21644Chris DeLuca2023-01-04
| | | | | | | | | | | Use `white-space: pre-wrap` to preserve white space as per `pre`, but to allow line wrapping if the display runs out of horizontal space. This prevents lines overflowing their box, and causing horizontal scrolling across the entire page on small screens. This `pre-wrap` technique is used by GitHub to format code for mobile. See https://developer.mozilla.org/en-US/docs/Web/CSS/white-space#pre-wrap
* feat!: remove hardcopyLewis Russell2023-01-03
| | | Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
* docs #20986Justin M. Keyes2022-12-11
| | | | | | - https://github.com/neovim/tree-sitter-vimdoc v1.2.4 eliminates most errors in pi_netrw.txt, so we can remove that workaround from ignore_parse_error(). - improved codeblock
* docs: dark/light color/accessibilty pass for generated html docs #21345Dave Lage2022-12-08
|
* feat(web): syntax highlighting via highlight.jsChristian Clason2022-12-02
| | | | | | | download from https://highlightjs.org/download/ place `highlight/` directory next to `css/` style needs adapting for Neovim colors
* feat(help): highlighted codeblocksChristian Clason2022-11-29
|
* vim-patch: bump VIM_VERSION from 8.0 => 8.1 #20762Justin M. Keyes2022-10-21
| | | | There are 6 remaining 8.0.x patches, tracked in: https://github.com/neovim/neovim/issues/5431
* docs: update vimdoc parser #20747Justin M. Keyes2022-10-20
| | | | | | | | | Remove the user-manual ToC from help.txt, because: 1. it duplicates usr_toc.txt 2. it is not what most readers are looking for in the main help page. fix https://github.com/neovim/tree-sitter-vimdoc/issues/49 fix https://github.com/neovim/tree-sitter-vimdoc/issues/50 fix https://github.com/neovim/tree-sitter-vimdoc/issues/51
* fix(docs-html): misaligned tabs after conceal #20690Yee Cheng Chin2022-10-20
| | | | | | | | | | | | | | | | Problem: `gen_help_html.lua` does not properly handle tab characters after "concealed" text (tags, taglinks, codespans). This causes misaligned layout in "old" (preformatted) docs. For text like `*tag*`, |tag_link|, and `code_span`, Vim hides the "*", "|", "`" characters, but Vim still counts those characters for "virtual column" when a tab character follows it. So if you have a tag of say 6 characters long, those two concealed character would lead to the tab character after it start at column 8. gen_help_html.lua doesn't account for that which leads to formatting flaws in the generated output. Solution: Add two spaces after concealed nodes that are followed by a tab char.
* feat(docs): update parser, HTML gen #20720Justin M. Keyes2022-10-18
| | | | | | | | | | Note: although the tolerance in help_spec.lua increased, the actual error count with the new parser decreased by about 20%. The difference is that the old ignore_parse_error() ignored many more errors with the old parser. fix https://github.com/neovim/tree-sitter-vimdoc/issues/37 fix https://github.com/neovim/tree-sitter-vimdoc/issues/44 fix https://github.com/neovim/tree-sitter-vimdoc/issues/47
* docs: fix/remove invalid URLs #20647Justin M. Keyes2022-10-14
|
* feat(docs-html): try to use tags for ToC headingsJustin M. Keyes2022-10-10
| | | | | | | | | | | | | Problem: The generated ToC (table of contents) uses anchors derived from the heading title, e.g. the "Global Plugins" heading yields: https://neovim.io/doc/user/usr_05.html#_global-plugins- so if the heading title changes, then the old URL (anchor) is broken. Solution: :help tags change less often than heading titles, so if a heading contains a *tag*, use that as its anchor name instead. Example: https://neovim.io/doc/user/usr_05.html#standard-plugin
* fix(docs-html): update parserJustin M. Keyes2022-10-10
| | | | | | | | | | | - Improve generated HTML by updating parser which includes fixes for single "'" and single "|": https://github.com/neovim/tree-sitter-vimdoc/pull/31 - Updated parser also fixes the conceal issue for "help" highlight queries https://github.com/neovim/tree-sitter-vimdoc/issues/23 by NOT including whitespace in nodes. - But this means we need to restore the getws() function which scrapes leading whitespace from the original input (buffer).
* docs: various #12823Justin M. Keyes2022-10-09
| | | | | | | | | | | | - increase python line-length limit from 88 => 100. - gen_help_html: fix bug in "tag" case (tbl_count => tbl_contains) ref #15632 fix #18215 fix #18479 fix #20527 fix #20532 Co-authored-by: Ben Weedon <ben@weedon.email>
* docs(news): add news.txt and link from README (#20426)Christian Clason2022-10-08
|
* fix(docs-html): keycodes, taglinks, column_heading #20498Justin M. Keyes2022-10-06
| | | | | | | | | | | | | | | | | | Problem: - Docs HTML: "foo ~" headings (column_heading) are not aligned with their table columns/contents because the leading whitespace is not emitted. - taglinks starting with hyphen like |-x| were not recognized. - keycodes like `<foo>` and `CTRL-x` were not recognized. - ToC is not scrollable. Solution: - Add ws() to the column_heading case. - Update help parser to latest version - supports `keycode` - fixes for taglink, argument - Update .toc CSS. https://github.com/neovim/neovim.github.io/issues/297 fix https://github.com/neovim/neovim.github.io/issues/297
* fix(docs): missing "(" in :help HTMLJustin M. Keyes2022-10-04
| | | | | | | | | | | | | | | | | Problem: Since https://github.com/neovim/tree-sitter-vimdoc/commit/eba7b5b646546d9fed9b40b2c72b9cc0048f1dfa any opening paren and its leading whitespace " (" are missing in the generated HTML. Example: Use ":qa!<Enter>" (careful, all changes are lost!). ^^missing Position the cursor on a tag (e.g. bars) and hit CTRL-]. ^^missing Solution: The main recursive loop only processes named children, so check named_child_count() instead of child_count(). Then anonymous nodes won't get lost.
* feat(docs): nested lists in HTML, update :help parserJustin M. Keyes2022-10-04
| | | | | | | | | | | | - Docs HTML: improvements in https://github.com/neovim/tree-sitter-vimdoc allow us to many hacks in `gen_help_html.lua`. - Docs HTML: support nested lists. - Docs HTML: avoid extra newlines (too much whitespace) in old (preformatted) layout. - Docs HTML: disable golden-grid for narrow viewport. - Workaround for https://github.com/neovim/neovim/issues/20404 closes https://github.com/neovim/neovim/issues/20404
* feat(docs): fixes for :help HTML generatorJustin M. Keyes2022-09-29
| | | | Generate correct leading whitespace for argument, taglink, tag, etc.
* feat(gen_help_html.lua): adapt to new parserJustin M. Keyes2022-09-28
| | | | | - adapt to parser changes from https://github.com/vigoux/tree-sitter-vimdoc/pull/16 - numerous other generator improvements
* feat(gen_help_html.lua): put commit-id in footerJustin M. Keyes2022-09-28
|