aboutsummaryrefslogtreecommitdiff
path: root/lua/muwiki/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/muwiki/init.lua')
-rw-r--r--lua/muwiki/init.lua48
1 files changed, 48 insertions, 0 deletions
diff --git a/lua/muwiki/init.lua b/lua/muwiki/init.lua
new file mode 100644
index 0000000..6dc088f
--- /dev/null
+++ b/lua/muwiki/init.lua
@@ -0,0 +1,48 @@
+
+local M = {}
+
+local config = require('muwiki.config')
+
+local function wiki_buffer()
+ return config.is_wiki_buffer(0)
+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
+
+return M