Skip to content

Commit 9cdfae2

Browse files
feat: Add alternative approach to interop with obsidian.nvim
## Details Merges suggestion from: #116
1 parent e7deb0f commit 9cdfae2

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,25 @@ The table below shows all the highlight groups with their default link
824824
> ui = { enable = false },
825825
> })
826826
> ```
827+
>
828+
> You can also do something more custom like lazy loading this plugin via a command
829+
> and adding logic to the config method to disable `obsidian.nvim` as suggested in
830+
> [#116](https://github.com/MeanderingProgrammer/markdown.nvim/issues/116), though
831+
> things like this can break at any time given the reliance on internal logic:
832+
>
833+
> ```lua
834+
> return {
835+
> 'MeanderingProgrammer/markdown.nvim',
836+
> name = 'render-markdown',
837+
> cmd = { 'RenderMarkdown' },
838+
> dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.nvim' },
839+
> config = function()
840+
> require('obsidian').get_client().opts.ui.enable = false
841+
> vim.api.nvim_buf_clear_namespace(0, vim.api.nvim_get_namespaces()['ObsidianUI'], 0, -1)
842+
> require('render-markdown').setup({})
843+
> end,
844+
> }
845+
> ```
827846
828847
## Images
829848

doc/render-markdown.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,24 @@ OBSIDIAN.NVIM *render-markdown-info-obsidian.nvim*
905905
ui = { enable = false },
906906
})
907907
<
908+
You can also do something more custom like lazy loading this plugin via a
909+
command and adding logic to the config method to disable `obsidian.nvim` as
910+
suggested in #116
911+
<https://github.com/MeanderingProgrammer/markdown.nvim/issues/116>, though
912+
things like this can break at any time given the reliance on internal logic:
913+
>lua
914+
return {
915+
'MeanderingProgrammer/markdown.nvim',
916+
name = 'render-markdown',
917+
cmd = { 'RenderMarkdown' },
918+
dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.nvim' },
919+
config = function()
920+
require('obsidian').get_client().opts.ui.enable = false
921+
vim.api.nvim_buf_clear_namespace(0, vim.api.nvim_get_namespaces()['ObsidianUI'], 0, -1)
922+
require('render-markdown').setup({})
923+
end,
924+
}
925+
<
908926

909927
IMAGES *render-markdown-info-images*
910928

0 commit comments

Comments
 (0)