-- mod-version:3 local core = require "core" local command = require "core.command" local common = require "core.common" local config = require "core.config" local keymap = require "core.keymap" local config = require "core.config" local common = require "core.common" config.plugins.ghmarkdown = common.merge({ -- string.format pattern to use for system.exec exec_format = PLATFORM == "Windows" and "start %s" or "xdg-open %q", -- the url to send POST request to url = "https://api.github.com/markdown/raw", -- The config specification used by the settings gui config_spec = { name = "Github Markdown Preview", { label = "Exec Pattern", description = "The string.format() pattern to pass to system.exec.", path = "exec_format", type = "string", default = PLATFORM == "Windows" and "start %s" or "xdg-open %q" }, { label = "URL", description = "The URL to POST the request to for formatting.", path = "url", type = "string", default = "https://api.github.com/markdown/raw" } } }, config.plugins.ghmarkdown) config.plugins.ghmarkdown = common.merge({ -- Find information on how to generate your own token at -- https://docs.github.com/en/rest/markdown/markdown?apiVersion=2022-11-28#render-a-markdown-document-in-raw-mode github_token = "", config_spec = { name = "GHMarkdown", { label = "GitHub token", description = "Enter your personal GitHub token", path = "github_token", type = "string", default = "" } } }, config.plugins.ghmarkdown) local html = [[