Commit Graph

39 Commits

Author SHA1 Message Date
zeertzjq
ca9f4a7cb1
docs: also change "vimL" and "viml" to "Vimscript" (#24414) 2023-07-21 16:30:05 +08:00
Justin M. Keyes
0a90e4b05a fix(docs): match DocSearch style with site theme
ref 2b4f9e4780
2023-07-08 16:06:46 +02:00
Justin M. Keyes
6da110d617
docs(gen_help_html): accept "~/" in file/dir params #24240 2023-07-03 05:04:43 -07:00
Justin M. Keyes
ab65a98adb
fix(docs): ignore_invalid #24174
Regex bug in scripts/gen_help_html.lua:ignore_invalid()
2023-06-27 10:21:27 -07:00
Justin M. Keyes
957d05d16b
fix(docs): too much whitespace around <pre> blocks #24151
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.
2023-06-25 12:29:56 -07:00
Justin M. Keyes
036da0d079 fix(docs): vimdoc syntax errors
gen_help_html: truncate parse-error sample text
2023-06-25 17:14:28 +02:00
Justin M. Keyes
4e6356559c
test: spellcheck :help (vimdoc) files #24109
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).
2023-06-22 03:44:51 -07:00
Justin M. Keyes
b0cf9c5fee feat(gen_help_html): ignore pi_netrw.txt errors
IDGAF about netrw
2023-06-22 10:18:24 +02:00
Justin M. Keyes
81d8fce8f9 feat(gen_help_html): non-default vimdoc.so parser
Callers can specify a non-default vimdoc.so file path.
2023-06-22 10:18:24 +02:00
Justin M. Keyes
5c73b1bb4c docs: lsp, vim_diff
- 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.
2023-06-22 10:18:17 +02:00
Justin M. Keyes
72a6643b13
docs #24061
- 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
2023-06-19 08:40:33 -07:00
Justin M. Keyes
36fd2fcaae
docs(html): define anchors for search engine #23879
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: 3913ebbfcd #23839
2023-06-02 02:45:23 -07:00
Justin M. Keyes
3913ebbfcd
docs(html): algolia docsearch #23839
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: ce9aef12eb
2023-05-30 17:32:38 -07:00
Christian Clason
bfb19a110d
docs(html): right-align inline tags (#23403) 2023-05-02 09:45:44 +02:00
Christian Clason
4d04feb662
feat(lua): vim.tbl_contains supports general tables and predicates (#23040)
* 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.
2023-04-14 10:39:57 +02:00
Christian Clason
d7f7450017 refactor(treesitter)!: rename help parser to vimdoc 2023-04-01 15:07:16 +02:00
Ching Pei Yang
ef89f9fd46
docs: treesitter.add_directive, add_predicate #21206 2023-01-16 04:39:19 -08:00
Chris DeLuca
1bd6e4469b
docs(website): soft wrap code blocks #21644
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
2023-01-04 07:15:08 -08:00
Lewis Russell
5841a97500
feat!: remove hardcopy
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2023-01-03 10:07:43 +00:00
Justin M. Keyes
1c324cb192
docs #20986
- 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
2022-12-11 18:41:26 -08:00
Dave Lage
ea39fc2cad
docs: dark/light color/accessibilty pass for generated html docs #21345 2022-12-08 14:00:18 -08:00
Christian Clason
9e1187e489 feat(web): syntax highlighting via highlight.js
download from https://highlightjs.org/download/
place `highlight/` directory next to `css/`

style needs adapting for Neovim colors
2022-12-02 16:05:00 +01:00
Christian Clason
5093f38c9f feat(help): highlighted codeblocks 2022-11-29 13:32:46 +01:00
Justin M. Keyes
24c9561a68
vim-patch: bump VIM_VERSION from 8.0 => 8.1 #20762
There are 6 remaining 8.0.x patches, tracked in:
https://github.com/neovim/neovim/issues/5431
2022-10-21 03:56:09 -07:00
Justin M. Keyes
e6917306f6
docs: update vimdoc parser #20747
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
2022-10-20 06:20:02 -07:00
Yee Cheng Chin
10ab7489eb
fix(docs-html): misaligned tabs after conceal #20690
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.
2022-10-20 03:22:46 -07:00
Justin M. Keyes
ef4c339fb9
feat(docs): update parser, HTML gen #20720
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
2022-10-18 07:18:44 -07:00
Justin M. Keyes
e5cb3104d0
docs: fix/remove invalid URLs #20647 2022-10-14 08:01:13 -07:00
Justin M. Keyes
6b01e9bf87 feat(docs-html): try to use tags for ToC headings
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
2022-10-10 01:05:18 +02:00
Justin M. Keyes
a7a83bc4c2 fix(docs-html): update parser
- 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).
2022-10-10 01:05:18 +02:00
Justin M. Keyes
09dffb9db7
docs: various #12823
- 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>
2022-10-09 05:21:52 -07:00
Christian Clason
93117b3587
docs(news): add news.txt and link from README (#20426) 2022-10-08 17:49:09 +02:00
Justin M. Keyes
f7b175e049
fix(docs-html): keycodes, taglinks, column_heading #20498
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
2022-10-06 06:16:00 -07:00
Justin M. Keyes
6abb481051 fix(docs): missing "(" in :help HTML
Problem:
Since eba7b5b646
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.
2022-10-04 21:15:06 +02:00
Justin M. Keyes
088abbeb6e feat(docs): nested lists in HTML, update :help parser
- 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
2022-10-04 16:49:17 +02:00
Justin M. Keyes
563bc39aac feat(docs): fixes for :help HTML generator
Generate correct leading whitespace for argument, taglink, tag, etc.
2022-09-29 13:26:12 +02:00
Justin M. Keyes
16336c486e feat(gen_help_html.lua): adapt to new parser
- adapt to parser changes from https://github.com/vigoux/tree-sitter-vimdoc/pull/16
- numerous other generator improvements
2022-09-28 18:34:20 +02:00
Justin M. Keyes
7b4c49888a feat(gen_help_html.lua): put commit-id in footer 2022-09-28 17:31:59 +02:00
Justin M. Keyes
09b64d75bd feat(docs): gen_help_html.lua
Problem:
The :help docs HTML generated is driven by an old awk script
`runtime/doc/makehtml.awk` that is hard to maintain (ad hoc parser and
no one has touched it in decades) and has bugs like:
- https://github.com/neovim/neovim.github.io/issues/96
- https://github.com/neovim/neovim.github.io/issues/97

Solution:
Use Lua + treesitter (https://github.com/vigoux/tree-sitter-vimdoc) to
generate :help docs HTML.  Also validates tag links.

fix https://github.com/neovim/neovim.github.io/issues/96
fix https://github.com/neovim/neovim.github.io/issues/97

TODO:
- delete doc_html build task
- delete runtime/doc/Makefile
- delete makehtml.awk
- delete maketags.awk

OUTPUT:

    $ nvim -V1 -es --clean +"lua require('scripts.gen_help_html')"
    output dir: /…/neovim.github.io/_site/doc/
    generated (207  errors): api.txt         => api.html
    generated (122  errors): arabic.txt      => arabic.html
    generated (285  errors): autocmd.txt     => autocmd.html
    generated (641  errors): builtin.txt     => builtin.html
    generated (623  errors): change.txt      => change.html
    generated (65   errors): channel.txt     => channel.html
    generated (353  errors): cmdline.txt     => cmdline.html
    generated (3    errors): debug.txt       => debug.html
    generated (28   errors): deprecated.txt  => deprecated.html
    generated (193  errors): dev_style.txt   => dev_style.html
    generated (460  errors): develop.txt     => develop.html
    generated (19   errors): diagnostic.txt  => diagnostic.html
    generated (57   errors): diff.txt        => diff.html
    generated (818  errors): digraph.txt     => digraph.html
    generated (330  errors): editing.txt     => editing.html
    generated (368  errors): eval.txt        => eval.html
    generated (184  errors): fold.txt        => fold.html
    generated (61   errors): ft_ada.txt      => ft_ada.html
    generated (0    errors): ft_ps1.txt      => ft_ps1.html
    generated (20   errors): ft_raku.txt     => ft_raku.html
    generated (5    errors): ft_rust.txt     => ft_rust.html
    generated (41   errors): ft_sql.txt      => ft_sql.html
    generated (110  errors): gui.txt         => gui.html
    generated (79   errors): hebrew.txt      => hebrew.html
    generated (17   errors): help.txt        => index.html
    generated (104  errors): helphelp.txt    => helphelp.html
    generated (0    errors): if_cscop.txt    => if_cscop.html
    generated (23   errors): if_perl.txt     => if_perl.html
    generated (16   errors): if_pyth.txt     => if_pyth.html
    generated (9    errors): if_ruby.txt     => if_ruby.html
    generated (216  errors): indent.txt      => indent.html
    generated (634  errors): index.txt       => vimindex.html
    generated (320  errors): insert.txt      => insert.html
    generated (265  errors): intro.txt       => intro.html
    generated (9    errors): job_control.txt => job_control.html
    generated (0    errors): lsp-extension.txt => lsp-extension.html
    generated (214  errors): lsp.txt         => lsp.html
    generated (311  errors): lua.txt         => lua.html
    generated (592  errors): luaref.txt      => luaref.html
    generated (798  errors): luvref.txt      => luvref.html
    generated (663  errors): map.txt         => map.html
    generated (228  errors): mbyte.txt       => mbyte.html
    generated (228  errors): message.txt     => message.html
    generated (0    errors): mlang.txt       => mlang.html
    generated (761  errors): motion.txt      => motion.html
    generated (4    errors): nvim.txt        => nvim.html
    generated (226  errors): nvim_terminal_emulator.txt => nvim_terminal_emulator.html
    generated (988  errors): options.txt     => options.html
    generated (567  errors): pattern.txt     => pattern.html
    generated (15   errors): pi_gzip.txt     => pi_gzip.html
    generated (10   errors): pi_health.txt   => pi_health.html
    generated (27   errors): pi_msgpack.txt  => pi_msgpack.html
    generated (2177 errors): pi_netrw.txt    => pi_netrw.html
    generated (41   errors): pi_paren.txt    => pi_paren.html
    generated (9    errors): pi_spec.txt     => pi_spec.html
    generated (218  errors): pi_tar.txt      => pi_tar.html
    generated (0    errors): pi_tutor.txt    => pi_tutor.html
    generated (235  errors): pi_zip.txt      => pi_zip.html
    generated (265  errors): print.txt       => print.html
    generated (31   errors): provider.txt    => provider.html
    generated (335  errors): quickfix.txt    => quickfix.html
    generated (572  errors): quickref.txt    => quickref.html
    generated (109  errors): recover.txt     => recover.html
    generated (14   errors): remote.txt      => remote.html
    generated (14   errors): remote_plugin.txt => remote_plugin.html
    generated (351  errors): repeat.txt      => repeat.html
    generated (23   errors): rileft.txt      => rileft.html
    generated (12   errors): russian.txt     => russian.html
    generated (6    errors): scroll.txt      => scroll.html
    generated (106  errors): sign.txt        => sign.html
    generated (347  errors): spell.txt       => spell.html
    generated (784  errors): starting.txt    => starting.html
    generated (1499 errors): syntax.txt      => syntax.html
    generated (23   errors): tabpage.txt     => tabpage.html
    generated (257  errors): tagsrch.txt     => tagsrch.html
    generated (31   errors): term.txt        => term.html
    generated (0    errors): testing.txt     => testing.html
    generated (96   errors): tips.txt        => tips.html
    generated (57   errors): treesitter.txt  => treesitter.html
    generated (71   errors): uganda.txt      => uganda.html
    generated (74   errors): ui.txt          => ui.html
    generated (87   errors): undo.txt        => undo.html
    generated (17   errors): userfunc.txt    => userfunc.html
    generated (1    errors): usr_01.txt      => usr_01.html
    generated (89   errors): usr_02.txt      => usr_02.html
    generated (293  errors): usr_03.txt      => usr_03.html
    generated (46   errors): usr_04.txt      => usr_04.html
    generated (96   errors): usr_05.txt      => usr_05.html
    generated (54   errors): usr_06.txt      => usr_06.html
    generated (20   errors): usr_07.txt      => usr_07.html
    generated (241  errors): usr_08.txt      => usr_08.html
    generated (130  errors): usr_09.txt      => usr_09.html
    generated (50   errors): usr_10.txt      => usr_10.html
    generated (33   errors): usr_11.txt      => usr_11.html
    generated (32   errors): usr_12.txt      => usr_12.html
    generated (22   errors): usr_20.txt      => usr_20.html
    generated (75   errors): usr_21.txt      => usr_21.html
    generated (8    errors): usr_22.txt      => usr_22.html
    generated (3    errors): usr_23.txt      => usr_23.html
    generated (163  errors): usr_25.txt      => usr_25.html
    generated (13   errors): usr_26.txt      => usr_26.html
    generated (84   errors): usr_27.txt      => usr_27.html
    generated (173  errors): usr_28.txt      => usr_28.html
    generated (285  errors): usr_29.txt      => usr_29.html
    generated (280  errors): usr_30.txt      => usr_30.html
    generated (11   errors): usr_31.txt      => usr_31.html
    generated (13   errors): usr_32.txt      => usr_32.html
    generated (156  errors): usr_40.txt      => usr_40.html
    generated (134  errors): usr_41.txt      => usr_41.html
    generated (35   errors): usr_42.txt      => usr_42.html
    generated (19   errors): usr_43.txt      => usr_43.html
    generated (60   errors): usr_44.txt      => usr_44.html
    generated (13   errors): usr_45.txt      => usr_45.html
    generated (1    errors): usr_toc.txt     => usr_toc.html
    generated (69   errors): various.txt     => various.html
    generated (68   errors): vi_diff.txt     => vi_diff.html
    generated (437  errors): vim_diff.txt    => vim_diff.html
    generated (296  errors): visual.txt      => visual.html
    generated (181  errors): windows.txt     => windows.html
    generated 119 html pages
    total errors: 23862
    invalid tags: 537
2022-09-22 15:36:27 +02:00