Skip to content

teamtype/teamtype-hedgedoc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Teamtype-HedgeDoc bridge prototype

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.

Setup

Bridge (this repo)

To build:

cargo build -r

Neovim plugin

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
        })
    end

Usage

Open any HedgeDoc URL with:

nvim <url>

About

Edit HedgeDoc documents using any editor with a Teamtype plugin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages