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!: rewrite TOhtml in lua #27097

Merged
merged 1 commit into from Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
951 changes: 0 additions & 951 deletions runtime/autoload/tohtml.vim

This file was deleted.

31 changes: 31 additions & 0 deletions runtime/doc/lua.txt
Expand Up @@ -4363,4 +4363,35 @@ vim.text.hexencode({str}) *vim.text.hexencode()*
(`string`) Hex encoded string


==============================================================================
Lua module: tohtml *vim.tohtml*


:TOhtml {file} *:TOhtml*
Converts the buffer shown in the current window to HTML, opens the generated
HTML in a new split window, and saves its contents to {file}. If {file} is not
given, a temporary file (created by |tempname()|) is used.


tohtml.tohtml({winid}, {opt}) *tohtml.tohtml.tohtml()*
Converts the buffer shown in the window {winid} to HTML and returns the
output as a list of string.

Parameters: ~
• {winid} (`integer?`) Window to convert (defaults to current window)
• {opt} (`table?`) Optional parameters.
• title (string): Title tag to set in the generated HTML code
(defaults to buffer name)
• number_lines (boolean): Show line numbers (defaults to
`false`)
• font (string|string[]): Fonts to use (defaults to
`guifont`)
• width (integer) Width used for items which are either right
aligned or repeat a character infinitely (defaults to
'textwidth' if non-zero or window width otherwise)

Return: ~
(`string[]`)


vim:tw=78:ts=8:sw=4:sts=4:et:ft=help:norl:
3 changes: 3 additions & 0 deletions runtime/doc/news.txt
Expand Up @@ -134,6 +134,9 @@ The following changes may require adaptations in user config or plugins.
If necessary, the respective capability can be
removed when calling |vim.lsp.protocol.make_client_capabilities()|.

• |:TOhtml| has been rewritten in Lua to support Neovim-specific decorations,
and many options have been removed.

==============================================================================
BREAKING CHANGES IN HEAD *news-breaking-dev*

Expand Down