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

feature: Add another obsidian.nvim workaround to README.md #116

Closed
pachungulo opened this issue Aug 3, 2024 · 1 comment
Closed

feature: Add another obsidian.nvim workaround to README.md #116

pachungulo opened this issue Aug 3, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@pachungulo
Copy link

Is your feature request related to a problem? Please describe.

I enjoy using markdown.nvim. However, I do find it a little bit more heavyweight than the built in ui to obsidian.nvim. The ideal solution would be to use both. If only there were a way to do that.... so I made one!

return {
  "MeanderingProgrammer/markdown.nvim",
  main = "render-markdown",
  name = "render-markdown", -- Only needed if you have another plugin named markdown.nvim
  cmd = { "RenderMarkdown" },
  -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.nvim' }, -- if you use the mini.nvim suite
  -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins
  dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-tree/nvim-web-devicons" }, -- if you prefer nvim-web-devicons
  config = function()
    local client = require("obsidian").get_client()
    client.opts.ui.enable = false
    local namespaceID = vim.api.nvim_get_namespaces()["ObsidianUI"]
    vim.api.nvim_buf_clear_namespace(0,namespaceID,0,-1) -- Clear all the obsidian UI stuff before loading this.
    require("render-markdown").setup({})
  end
}

Running the changes made to config after the plugin loads turns off the obsidian ui and clears it, then enables markdown.nvim! Loading is triggered by running the command RenderMarkdown.

Describe the solution you'd like

Simply add my code to the obsidian.nvim section of README.md. I'd be happy to submit a PR myself if you'd like!

Describe alternatives you've considered

I have considered using only markdown.nvim, but I didn't editing in it as much as I liked reading in it as a sort of preview. This solution allows me to have my cake and eat it too, and I was thinking other people would like to see it. Up to you!

Additional information

No response

@pachungulo pachungulo added the enhancement New feature or request label Aug 3, 2024
MeanderingProgrammer added a commit that referenced this issue Aug 4, 2024
@MeanderingProgrammer
Copy link
Owner

Sure added: https://github.com/MeanderingProgrammer/markdown.nvim?tab=readme-ov-file#obsidiannvim

Definitely a use at your own risk kind of thing, but more options are always good.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants