This bridge allows you to edit HedgeDoc documents using any editor with a Teamtype plugin.
Note: This is still buggy. Don't use in production.
To build:
cargo build -r
Install the Teamtype Neovim plugin.
Configuration (for Lazy):
init = function()
local teamtype = require("teamtype")
teamtype.config("hedgedoc", {
cmd = {
os.getenv("HOME") .. "/path/to/teamtype-hedgedoc/target/release/teamtype-hedgedoc"
},
root_dir = function(bufnr, on_dir)
local name = vim.api.nvim_buf_get_name(bufnr)
if string.find(name, "https://") == 1 then
on_dir("/tmp")
end
end,
})
teamtype.enable("hedgedoc")
-- Disable two mechanism that would *download* URLs when opening them:
-- Disable netrw, for Neovim < 0.12.
vim.g.loaded_netrwPlugin = 1
vim.g.loaded_netrw = 1
-- Disable vim.net.request() callback, for Neovim >= 0.12.
vim.api.nvim_create_autocmd("SourcePost", {
pattern = "*/runtime/plugin/net.lua",
callback = function()
vim.api.nvim_create_augroup("nvim.net.remotefile", {clear = true})
vim.api.nvim_del_augroup_by_name("nvim.net.remotefile")
end
})
endOpen any HedgeDoc URL with:
nvim <url>