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

docs(gen_help_html.lua): fix broken pre text, and handle linewrap #28755

Merged
merged 1 commit into from
May 16, 2024

Conversation

wookayin
Copy link
Member

@wookayin wookayin commented May 15, 2024

Problem:

Solution:

@wookayin
Copy link
Member Author

wookayin commented May 15, 2024

This PR has a slightly different result than the "word-break" solution #28678:

how #28678 is fixed like

but it should be a pretty reasonable rendering.

Also, codeblocks will now look like "nowrap":

now looks like this

instead of, for example: https://neovim.io/doc/user/dev_vimpatch.html#dev-vimpatch-list-management

@github-actions github-actions bot requested a review from clason May 15, 2024 04:02
@wookayin wookayin requested a review from justinmk May 15, 2024 04:07
@clason
Copy link
Member

clason commented May 15, 2024

Apropos: while you're at it, can you add handling for the nodes

  • modeline (do nothing, i.e., return '')
  • note (maybe make bold?)

(Not a blocker; just wanted to make a note for the record.)

scripts/gen_help_html.lua Outdated Show resolved Hide resolved
Copy link
Member

@justinmk justinmk left a comment

Choose a reason for hiding this comment

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

This is definitely a needed fix since the previous PR, thanks.

BTW (off topic): dev_vimpatch should use "flow" layout. Fixed: #28747

Problem:

- Since neovim#28678, pre-formatted text in the online documentation do not
  render whitespaces correctly: should be pre-like text, but shown like
  normal paragraph (see neovim#28754).

- Code blocks with long lines should not be wrapped (e.g. see
  |dev-vimpatch-list-management|).

Solution:

- Use `white-space: pre-wrap`. Compared to `white-space: pre`, this
  option will make long lines including a very long URL wrapped.
  This properly fixes neovim#28754 and neovim#28678.

- Use horizontal scrollbar for the code blocks that are horizontally too
  long, instead of wrapping text. This will make the code easy to read
  while the pre-text block not interfering with the navigation bar.
@wookayin
Copy link
Member Author

Anything missing before 0.10?

@clason clason merged commit 174da7f into neovim:master May 16, 2024
29 checks passed
@github-actions github-actions bot removed the request for review from clason May 16, 2024 07:01
@clason
Copy link
Member

clason commented May 16, 2024

(The 0.10 release is unrelated because the docs are always generated from HEAD.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Online documentation contains strange wrapping
4 participants