blob: 7f0404bce094f310d73a8f552b21274a63a279dd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
local M = {}
local config = require('muwiki.config')
local function wiki_buffer()
return config.wiki_root(0) ~= nil
end
M.setup = function(opts)
config.setup(opts)
end
function M.open_link()
if wiki_buffer() then
require('muwiki.links.open').open_link()
end
end
function M.next_link()
if wiki_buffer() then
require('muwiki.links.navigation').next_link()
end
end
function M.prev_link()
if wiki_buffer() then
require('muwiki.links.navigation').prev_link()
end
end
function M.open_link_with()
if wiki_buffer() then
require('muwiki.links.open').open_link_with()
end
end
function M.create_link()
if wiki_buffer() then
require('muwiki.links.creation').create_link()
end
end
function M.open_index(name)
require('muwiki.files').open_index(name)
end
function M.wiki_root(bufnr)
return config.wiki_root(bufnr)
end
return M
|