feat!: rewrite TOhtml in lua

Co-authored-by: wookayin <wookayin@gmail.com>
Co-authored-by: clason <c.clason@uni-graz.at>
Co-authored-by: Lewis Russell <me@lewisr.dev>
This commit is contained in:
altermo
2024-02-26 11:42:51 -08:00
committed by Lewis Russell
parent c538ec8522
commit 2f85bbe615
11 changed files with 1761 additions and 3708 deletions

11
runtime/plugin/tohtml.lua Normal file
View File

@@ -0,0 +1,11 @@
if vim.g.loaded_2html_plugin ~= nil then
return
end
vim.g.loaded_2html_plugin = true
vim.api.nvim_create_user_command('TOhtml', function(args)
local outfile = args.args ~= '' and args.args or vim.fn.tempname() .. '.html'
local html = require('tohtml').tohtml()
vim.fn.writefile(html, outfile)
vim.cmd.split(outfile)
end, { bar = true, nargs = '?' })