/offline-docs.xplr

Fetch the appropriate version of xplr docs and browse offline

Primary LanguageLuaMIT LicenseMIT

Offline Docs

This plugin makes it easy to fetch the appropriate version of xplr docs and browse offline.

Usage

  • Type : ? to browse the offline docs.
  • Delete the docs directory and try the same keys to re-fetch the docs.

Requirements

  • curl
  • tar

Installation

Install using xpm.xplr

require("xpm").setup({
  -- ...
  { name = "sayanarijit/offline-docs.xplr" },
  -- ...
})

Install manually

  • Add the following line in ~/.config/xplr/init.lua

    local home = os.getenv("HOME")
    package.path = home
      .. "/.config/xplr/plugins/?/init.lua;"
      .. home
      .. "/.config/xplr/plugins/?.lua;"
      .. package.path
  • Clone the plugin

    mkdir -p ~/.config/xplr/plugins
    
    git clone https://github.com/sayanarijit/offline-docs.xplr ~/.config/xplr/plugins/offline-docs
  • Require the module in ~/.config/xplr/init.lua

    require("offline-docs").setup()
    
    -- Or
    
    require("offline-docs").setup{
      mode = "action",
      key = "?",
      local_path = os.getenv("HOME") .. "/.local/share/xplr/doc/" .. version
    }