Skip to content

Commit

Permalink
feat!: rewrite TOhtml in lua
Browse files Browse the repository at this point in the history
  • Loading branch information
MariaSolOs authored and altermo committed Feb 27, 2024
1 parent 63f9c2d commit f1671be
Show file tree
Hide file tree
Showing 12 changed files with 3,531 additions and 3,708 deletions.
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

0 comments on commit f1671be

Please sign in to comment.