### Usage Example Source: https://github.com/oxy2dev/markview.nvim/blob/main/doc/markview.nvim-presets.txt Example of how to require and use presets in the setup function. ```lua local presets = require("markview.presets"); require("markview").setup({ markdown = { headings = presets.headings.glow } }); --- You can again call `setup()` to modify --- the options without changing the preset. require("markview").setup({ markdown = { headings = { shift_width = 1 } } }); ``` -------------------------------- ### Example List Items Configuration Source: https://github.com/oxy2dev/markview.nvim/blob/main/doc/markview.nvim-markdown.txt Example implementation of list item configuration. ```lua list_items = { enable = true, wrap = true, indent_size = function (buffer) if type(buffer) ~= "number" then return vim.bo.shiftwidth or 4; end --- Use 'shiftwidth' value. return vim.bo[buffer].shiftwidth or 4; end, shift_width = 4, marker_minus = { add_padding = true, conceal_on_checkboxes = true, text = "●", hl = "MarkviewListItemMinus" }, marker_plus = { add_padding = true, conceal_on_checkboxes = true, text = "◈", hl = "MarkviewListItemPlus" }, marker_star = { add_padding = true, conceal_on_checkboxes = true, text = "◇", hl = "MarkviewListItemStar" }, marker_dot = { text = function (_, item) return string.format("%d.", item.n); end, hl = "@markup.list.markdown", add_padding = true, conceal_on_checkboxes = true }, marker_parenthesis = { text = function (_, item) return string.format("%d)", item.n); end, hl = "@markup.list.markdown", add_padding = true, conceal_on_checkboxes = true } }, ``` -------------------------------- ### Example configuration for checkboxes Source: https://github.com/oxy2dev/markview.nvim/blob/main/doc/markview.nvim-markdown_inline.txt Example configuration for checkboxes. ```lua checkboxes = { enable = true, checked = { text = "󰗠", hl = "MarkviewCheckboxChecked", scope_hl = "MarkviewCheckboxChecked" }, unchecked = { text = "󰄰", hl = "MarkviewCheckboxUnchecked", scope_hl = "MarkviewCheckboxUnchecked" }, ["/"] = { text = "󱎖", hl = "MarkviewCheckboxPending" }, [">"] = { text = "", hl = "MarkviewCheckboxCancelled" }, ["<"] = { text = "󰃖", hl = "MarkviewCheckboxCancelled" }, ["-"] = { text = "󰍶", hl = "MarkviewCheckboxCancelled", scope_hl = "MarkviewCheckboxStriked" }, ["?"] = { text = "󰋗", hl = "MarkviewCheckboxPending" }, ["!"] = { text = "󰀦", hl = "MarkviewCheckboxUnchecked" }, ["*"] = { text = "󰓎", hl = "MarkviewCheckboxPending" }, ['"'] = { text = "󰸥", hl = "MarkviewCheckboxCancelled" }, ["l"] = { text = "󰆋", hl = "MarkviewCheckboxProgress" }, ["b"] = { text = "󰃀", hl = "MarkviewCheckboxProgress" }, ["i"] = { text = "󰰄", hl = "MarkviewCheckboxChecked" }, ["S"] = { text = "", hl = "MarkviewCheckboxChecked" }, ["I"] = { text = "󰛨", hl = "MarkviewCheckboxPending" }, ["p"] = { text = "", hl = "MarkviewCheckboxChecked" }, ["c"] = { text = "", hl = "MarkviewCheckboxUnchecked" }, ["f"] = { text = "󱠇", hl = "MarkviewCheckboxUnchecked" }, ["k"] = { text = "", hl = "MarkviewCheckboxPending" }, ["w"] = { text = "", hl = "MarkviewCheckboxProgress" }, ["u"] = { text = "󰔵", hl = "MarkviewCheckboxChecked" }, ["d"] = { text = "󰔳", hl = "MarkviewCheckboxUnchecked" }, }, ``` -------------------------------- ### Example Usage Source: https://github.com/oxy2dev/markview.nvim/wiki/Markdown inline Example configuration for block references. ```lua block_references = { enable = true, default = { icon = "󰿨 ", hl = "MarkviewPalette6Fg", file_hl = "MarkviewPalette0Fg", }, }, ``` -------------------------------- ### General Setup with Presets Source: https://github.com/oxy2dev/markview.nvim/wiki/Presets Demonstrates how to use presets for markdown headings in the general setup. ```lua local presets = require("markview.presets"); require("markview").setup({ markdown = { headings = presets.headings.glow } }); --- You can again call `setup()` to modify --- the options without changing the preset. require("markview").setup({ markdown = { headings = { shift_width = 1 } } }); ``` -------------------------------- ### vim.pack Installation Source: https://github.com/oxy2dev/markview.nvim/blob/main/README.md Installation snippet for vim.pack. ```lua vim.pack.add({ "https://github.com/OXY2DEV/markview.nvim", }) ``` -------------------------------- ### Vim-plug Installation Source: https://github.com/oxy2dev/markview.nvim/blob/main/README.md Installation snippet for vim-plug. ```vim Plug 'OXY2DEV/markview.nvim' ``` -------------------------------- ### Code Blocks Configuration Example Source: https://github.com/oxy2dev/markview.nvim/blob/main/doc/markview.nvim-markdown.txt Example configuration for rendering code blocks with various options. ```lua code_blocks = { enable = true, border_hl = "MarkviewCode", info_hl = "MarkviewCodeInfo", label_direction = "right", label_hl = nil, min_width = 60, pad_amount = 2, pad_char = " ", default = { block_hl = "MarkviewCode", pad_hl = "MarkviewCode" }, ["diff"] = { block_hl = function (_, line) if line:match("^%+") then return "MarkviewPalette4"; elseif line:match("^%-бет") then return "MarkviewPalette1"; else return "MarkviewCode"; end end, pad_hl = "MarkviewCode" }, style = "block", sign = true, }, ``` -------------------------------- ### Example List Items Configuration Source: https://github.com/oxy2dev/markview.nvim/wiki/Markdown Example Lua configuration for list items. ```lua list_items = { enable = true, wrap = true, indent_size = function (buffer) if type(buffer) ~= "number" then return vim.bo.shiftwidth or 4; end -- Use 'shiftwidth' value. return vim.bo[buffer].shiftwidth or 4; end, shift_width = 4, marker_minus = { add_padding = true, conceal_on_checkboxes = true, text = "●", hl = "MarkviewListItemMinus" }, marker_plus = { add_padding = true, conceal_on_checkboxes = true, text = "◈", hl = "MarkviewListItemPlus" }, marker_star = { add_padding = true, conceal_on_checkboxes = true, text = "◇", hl = "MarkviewListItemStar" }, marker_dot = { text = function (_, item) return string.format("%d.", item.n); end, hl = "@markup.list.markdown", add_padding = true, conceal_on_checkboxes = true }, marker_parenthesis = { text = function (_, item) return string.format("%d)", item.n); end, hl = "@markup.list.markdown", add_padding = true, conceal_on_checkboxes = true } }, ``` -------------------------------- ### Example TOC Configuration Source: https://github.com/oxy2dev/markview.nvim/wiki/Asciidoc An example of how to set up the Table of Contents configuration in markview.nvim. ```lua tocs = { enable = true, shift_width = 2, hl = "MarkviewPalette2Fg", sign = "󰙅 ", sign_hl = "MarkviewPalette2Sign", depth_1 = { icon = "◆ ", icon_hl = "Comment", hl = "MarkviewPalette5Fg", }, depth_2 = { icon = "◇ ", icon_hl = "Comment", hl = "MarkviewPalette5Fg", }, depth_3 = { icon = "◆ ", icon_hl = "Comment", hl = "MarkviewPalette5Fg", }, depth_4 = { icon = "◇ ", icon_hl = "Comment", hl = "MarkviewPalette5Fg", }, depth_5 = { icon = "◆ ", icon_hl = "Comment", hl = "MarkviewPalette5Fg", }, }, ``` -------------------------------- ### Example LaTeX Blocks Configuration Source: https://github.com/oxy2dev/markview.nvim/wiki/LaTeX An example configuration for enabling and styling LaTeX math blocks. ```lua blocks = { enable = true, hl = "MarkviewCode", pad_char = " ", pad_amount = 3, text = "  LaTeX ", text_hl = "MarkviewCodeInfo" }, ``` -------------------------------- ### Lazy.nvim Installation (plugins.lua) Source: https://github.com/oxy2dev/markview.nvim/blob/main/README.md Installation snippet for lazy.nvim, specifically for plugins.lua. ```lua -- For `plugins.lua` users. { "OXY2DEV/markview.nvim", lazy = false, -- Completion for `blink.cmp` -- dependencies = { "saghen/blink.cmp" }, }, ``` -------------------------------- ### Example Code Blocks Configuration Source: https://github.com/oxy2dev/markview.nvim/wiki/Typst Example configuration for rendering Typst code blocks. ```lua code_blocks = { enable = true, hl = "MarkviewCode", min_width = 60, pad_amount = 3, pad_char = " ", style = "block", text = "󰣖 Code", text_direction = "right", text_hl = "MarkviewIcon5" }, ``` -------------------------------- ### Example Typst URL Links Configuration Source: https://github.com/oxy2dev/markview.nvim/wiki/Typst An example configuration demonstrating how to customize URL link rendering for various domains. ```lua url_links = { enable = true, default = { icon = " ", hl = "MarkviewEmail" }, ["github%.com/[%a%d%-%_%.]+%/?$"] = { --- github.com/ icon = " ", hl = "MarkviewPalette0Fg" }, ["github%.com/[%a%d%-%_%.]+/[%a%d%-%_%.]+%/?$"] = { --- github.com// icon = " ", hl = "MarkviewPalette0Fg" }, ["github%.com/[%a%d%-%_%.]+/[%a%d%-%_%.]+/tree/[%a%d%-%_%.]+%/?$"] = { --- github.com///tree/ icon = " ", hl = "MarkviewPalette0Fg" }, ["github%.com/[%a%d%-%_%.]+/[%a%d%-%_%.]+/commits/[%a%d%-%_%.]+%/?$"] = { --- github.com///commits/ icon = " ", hl = "MarkviewPalette0Fg" }, ["github%.com/[%a%d%-%_%.]+/[%a%d%-%_%.]+%/releases$"] = { --- github.com///releases icon = " ", hl = "MarkviewPalette0Fg" }, ["github%.com/[%a%d%-%_%.]+/[%a%d%-%_%.]+%/tags$"] = { --- github.com///tags icon = " ", hl = "MarkviewPalette0Fg" }, ["github%.com/[%a%d%-%_%.]+/[%a%d%-%_%.]+%/issues$"] = { --- github.com///issues icon = " ", hl = "MarkviewPalette0Fg" }, ["github%.com/[%a%d%-%_%.]+/[%a%d%-%_%.]+%/pulls$"] = { --- github.com///pulls icon = " ", hl = "MarkviewPalette0Fg" }, ["github%.com/[%a%d%-%_%.]+/[%a%d%-%_%.]+%/wiki$"] = { --- github.com///wiki icon = " ", hl = "MarkviewPalette0Fg" }, ["developer%.mozilla%.org"] = { priority = -9999, icon = "󰖟 ", hl = "MarkviewPalette5Fg" }, ["w3schools%.com"] = { priority = -9999, icon = " ", hl = "MarkviewPalette4Fg" }, ["stackoverflow%.com"] = { priority = -9999, icon = "󰓌 ", hl = "MarkviewPalette2Fg" }, ["reddit%.com"] = { priority = -9999, icon = " ", hl = "MarkviewPalette2Fg" }, ["github%.com"] = { priority = -9999, icon = " ", hl = "MarkviewPalette6Fg" }, ["gitlab%.com"] = { priority = -9999, icon = "󰮠 ", hl = "MarkviewPalette2Fg" }, ["dev%.to"] = { priority = -9999, icon = "󱁴 ", hl = "MarkviewPalette0Fg" }, ["codepen%.io"] = { priority = -9999, icon = " ", hl = "MarkviewPalette6Fg" }, ["replit%.com"] = { priority = -9999, icon = " ", hl = "MarkviewPalette2Fg" }, ["jsfiddle%.net"] = { priority = -9999, icon = " ", hl = "MarkviewPalette5Fg" }, ["npmjs%.com"] = { priority = -9999, icon = " ", hl = "MarkviewPalette0Fg" }, ["pypi%.org"] = { priority = -9999, icon = "󰆦 ", hl = "MarkviewPalette0Fg" }, ["mvnrepository%.com"] = { priority = -9999, icon = " ", hl = "MarkviewPalette1Fg" }, ["medium%.com"] = { priority = -9999, icon = " ", hl = "MarkviewPalette6Fg" }, ["linkedin%.com"] = { priority = -9999, icon = "󰌻 ", hl = "MarkviewPalette5Fg" }, ["news%.ycombinator%.com"] = { priority = -9999, icon = " ", hl = "MarkviewPalette2Fg" }, } ``` -------------------------------- ### URI Configuration Example Source: https://github.com/oxy2dev/markview.nvim/blob/main/doc/markview.nvim-asciidoc_inline.txt Example configuration for enabling URI rendering and setting default styles, including specific styles for GitHub URLs. ```lua uris = { enable = true, default = { icon = "󰌷 ", hl = "MarkviewHyperlink", }, ---|fS --NOTE(@OXY2DEV): Github sites. ["github%.com/[%a%d%-%_%.]+%/?$"] = { --- github.com/ icon = " ", hl = "MarkviewPalette0Fg", text = function (_, item) return string.match(item.destination, "github%.com/([%a%d%-%_%.]+)%/?$"); end }, ["github%.com/[%a%d%-%_%.]+/[%a%d%-%_%.]+%/?$"] = { --- github.com// icon = "󰳐 ", hl = "MarkviewPalette0Fg", text = function (_, item) return string.match(item.destination, "github%.com/([%a%d%-%_%.]+/[%a%d%-%_%.]+)%/?$"); end }, ["github%.com/[%a%d%-%_%.]+/[%a%d%-%_%.]+/tree/[%a%d%-%_%.]+%/?$"] = { --- github.com///tree/ icon = " ", hl = "MarkviewPalette0Fg", text = function (_, item) local repo, branch = string.match(item.destination, "github%.com/([%a%d%-%_%.]+/[%a%d%-%_%.]+)/tree/([%a%d%-%_%.]+)%/?$"); return repo .. " at " .. branch; end }, ["github%.com/[%a%d%-%_%.]+/[%a%d%-%_%.]+/commits/[%a%d%-%_%.]+%/?$"] = { --- github.com///commits/ icon = " ", hl = "MarkviewPalette0Fg", text = function (_, item) return string.match(item.destination, "github%.com/([%a%d%-%_%.]+/[%a%d%-%_%.]+/commits/[%a%d%-%_%.]+)%/?$"); end }, ["github%.com/[%a%d%-%_%.]+/[%a%d%-%_%.]+/releases$"] = { --- github.com///releases icon = " ", hl = "MarkviewPalette0Fg", text = function (_, item) return "Releases • " .. string.match(item.destination, "github%.com/([%a%d%-%_%.]+/[%a%d%-%_%.]+)%/releases$"); end }, ``` -------------------------------- ### Tag Configuration Example Source: https://github.com/oxy2dev/markview.nvim/blob/main/doc/markview.nvim-markdown_inline.txt Example configuration for enabling and customizing the rendering of Obsidian-style tags. ```lua require("markview.config.markdown_inline").tags = { default = { hl = "MarkviewPalette7", padding_left = " ", padding_right = " " }, enable = true } ``` -------------------------------- ### Lazy.nvim Installation (plugins/markview.lua) Source: https://github.com/oxy2dev/markview.nvim/blob/main/README.md Installation snippet for lazy.nvim, specifically for plugins/markview.lua. ```lua -- For `plugins/markview.lua` users. return { "OXY2DEV/markview.nvim", lazy = false, -- Completion for `blink.cmp` -- dependencies = { "saghen/blink.cmp" }, }; ``` -------------------------------- ### Default autolinks configuration example Source: https://github.com/oxy2dev/markview.nvim/blob/main/doc/markview.nvim-comment.txt An example demonstrating the default configuration for autolinks, including icons and highlight groups. ```lua autolinks = { enable = true, default = { icon = "󰋽 ", hl = "MarkviewPalette6", }, ---|fS --NOTE(@OXY2DEV): Github sites. ["github%.com/[%a%d%-%_%.]+%/?$"] = { --- github.com/ icon = " ", hl = "MarkviewPalette0Fg", text = function (_, item) return string.match(item.destination, "github%.com/([%a%d%-%_%.]+)%/?$"); end }, ["github%.com/[%a%d%-%_%.]+/[%a%d%-%_%.]+%/?$"] = { --- github.com// icon = "󰳐 ", hl = "MarkviewPalette0Fg", text = function (_, item) return string.match(item.destination, "github%.com/([%a%d%-%_%.]+/[%a%d%-%_%.]+)%/?$"); end }, ["github%.com/[%a%d%-%_%.]+/[%a%d%-%_%.]+/tree/[%a%d%-%_%.]+%/?$"] = { --- github.com///tree/ icon = " ", hl = "MarkviewPalette0Fg", text = function (_, item) local repo, branch = string.match(item.destination, "github%.com/([%a%d%-%_%.]+/[%a%d%-%_%.]+)/tree/([%a%d%-%_%.]+)%/?$"); return repo .. " at " .. branch; end }, ["github%.com/[%a%d%-%_%.]+/[%a%d%-%_%.]+/commits/[%a%d%-%_%.]+%/?$"] = { --- github.com///commits/ icon = " ", hl = "MarkviewPalette0Fg", text = function (_, item) return string.match(item.destination, "github%.com/([%a%d%-%_%.]+/[%a%d%-%_%.]+/commits/[%a%d%-%_%.]+)%/?$"); end }, ["github%.com/[%a%d%-%_%.]+/[%a%d%-%_%.]+%/releases$"] = { --- github.com///releases icon = " ", hl = "MarkviewPalette0Fg", text = function (_, item) return "Releases • " .. string.match(item.destination, "github%.com/([%a%d%-%_%.]+/[%a%d%-%_%.]+)%/releases$"); end }, ["github%.com/[%a%d%-%_%.]+/[%a%d%-%_%.]+%/tags$"] = { --- github.com///tags icon = " ", hl = "MarkviewPalette0Fg", text = function (_, item) return "Tags • " .. string.match(item.destination, "github%.com/([%a%d%-%_%.]+/[%a%d%-%_%.]+)%/tags$"); end }, ["github%.com/[%a%d%-%_%.]+/[%a%d%-%_%.]+%/issues$"] = { --- github.com///issues icon = " ", hl = "MarkviewPalette0Fg", text = function (_, item) return "Issues • " .. string.match(item.destination, "github%.com/([%a%d%-%_%.]+/[%a%d%-%_%.]+)%/issues$"); end }, ["github%.com/[%a%d%-%_%.]+/[%a%d%-%_%.]+%/pulls$"] = { --- github.com///pulls icon = " ", hl = "MarkviewPalette0Fg", text = function (_, item) return "Pull requests • " .. string.match(item.destination, "github%.com/([%a%d%-%_%.]+/[%a%d%-%_%.]+)%/pulls$"); end }, ["github%.com/[%a%d%-%_%.]+/[%a%d%-%_%.]+%/wiki$"] = { --- github.com///wiki icon = " ", hl = "MarkviewPalette0Fg", ``` -------------------------------- ### delimited_blocks configuration example Source: https://github.com/oxy2dev/markview.nvim/wiki/Asciidoc Example configuration for delimited blocks. ```lua delimited_blocks = { enable = true, hl = "MarkviewCode" }, ``` -------------------------------- ### Code block editor setup Source: https://github.com/oxy2dev/markview.nvim/wiki/Extras Setup function for the code block editor module. ```lua require("markview.extras.editor").setup(); ``` -------------------------------- ### Prefer Neovim Configuration Example Source: https://github.com/oxy2dev/markview.nvim/blob/main/doc/markview.nvim-experimental.txt Example of setting `prefer_nvim` to false. ```lua prefer_nvim = false, ``` -------------------------------- ### Block Quotes Example Source: https://github.com/oxy2dev/markview.nvim/blob/main/doc/markview.nvim-asciidoc.txt Example configuration for block quotes. ```lua block_quotes = { enable = true, default = { border = "▋", hl = "MarkviewBlockQuoteDefault" }, }, ``` -------------------------------- ### Raw Previews Configuration Example Source: https://github.com/oxy2dev/markview.nvim/wiki/Preview Example configuration for `raw_previews` to show everything except block quotes and tables as raw text in hybrid mode. ```lua raw_previews = { markdown = { "!block_quotes", "!tables" } } ``` -------------------------------- ### YAML Properties Configuration Example Source: https://github.com/oxy2dev/markview.nvim/blob/main/doc/markview.nvim-yaml.txt An example demonstrating the configuration of YAML properties, including data types and specific property overrides. ```lua properties = { enable = true, data_types = { ["text"] = { text = "󰗊 ", hl = "MarkviewIcon4" }, ["list"] = { text = "󰝖 ", hl = "MarkviewIcon5" }, ["number"] = { text = " ", hl = "MarkviewIcon6" }, ["checkbox"] = { ---@diagnostic disable text = function (_, item) return item.value == "true" and "󰄲 " or "󰄱 " end, ---@diagnostic enable hl = "MarkviewIcon6" }, ["date"] = { text = "󰃭 ", hl = "MarkviewIcon2" }, ["date_&_time"] = { text = "󰥔 ", hl = "MarkviewIcon3" } }, default = { use_types = true, border_top = nil, border_middle = nil, border_bottom = nil, border_hl = nil, }, ["^tags$"] = { use_types = false, text = "󰓹 ", hl = "MarkviewIcon0" }, ["^aliases$"] = { match_string = "^aliases$", use_types = false, text = "󱞫 ", hl = "MarkviewIcon2" }, ["^cssclasses$"] = { match_string = "^cssclasses$", use_types = false, text = " ", hl = "MarkviewIcon3" }, ["^publish$"] = { match_string = "^publish$", use_types = false, text = "󰅧 ", hl = "MarkviewIcon5" }, ["^permalink$"] = { match_string = "^permalink$", use_types = false, text = " ", hl = "MarkviewIcon2" }, ["^description$"] = { match_string = "^description$", use_types = false, text = "󰋼 ", hl = "MarkviewIcon0" }, ["^image$"] = { match_string = "^image$", use_types = false, text = "󰋫 ", hl = "MarkviewIcon4" }, ["^cover$"] = { match_string = "^cover$", use_types = false, text = "󰹉 ", hl = "MarkviewIcon2" } } ``` -------------------------------- ### Diff line highlighting example Source: https://github.com/oxy2dev/markview.nvim/wiki/Asciidoc Example of language-specific line highlighting for diff files. ```lua ["diff"] = { block_hl = function (_, line) if line:match("^%+") then return "MarkviewPalette4"; elseif line:match("^%-бет") then return "MarkviewPalette1"; else return "MarkviewCode"; end end, pad_hl = "MarkviewCode" }, ``` -------------------------------- ### Example LaTeX Command Configuration Source: https://github.com/oxy2dev/markview.nvim/blob/main/doc/markview.nvim-latex.txt An example of configuring a specific LaTeX command ('boxed') with custom conditions and visual elements. ```lua commands = { enable = true, ["boxed"] = { condition = function (item) return #item.args == 1; end, on_command = { conceal = "" }, on_args = { { on_before = function (item) return { end_col = item.range[2] + 1, conceal = "", virt_text_pos = "inline", virt_text = { { " ", "MarkviewPalette4Fg" }, { "[", "@punctuation.bracket.latex" } }, hl_mode = "combine" } end, after_offset = function (range) ``` -------------------------------- ### Autolink Configuration Example Source: https://github.com/oxy2dev/markview.nvim/wiki/Comment Example configuration for various autolinks with icons and custom text formatting. ```lua ["pypi%.org"] = { priority = -9999, icon = "󰆦 ", hl = "MarkviewPalette0Fg" }, ["mvnrepository%.com"] = { priority = -9999, icon = " ", hl = "MarkviewPalette1Fg" }, ["medium%.com"] = { priority = -9999, icon = " ", hl = "MarkviewPalette6Fg" }, ["linkedin%.com"] = { priority = -9999, icon = "󰌻 ", hl = "MarkviewPalette5Fg" }, ["news%.ycombinator%.com"] = { priority = -9999, icon = " ", hl = "MarkviewPalette2Fg" }, ["neovim%.io/doc/user/.*#%_?.*$"] = { icon = " ", hl = "MarkviewPalette4Fg", text = function (_, item) local file, tag = string.match(item.destination, "neovim%.io/doc/user/(.*)#%_?(.*)$"); --- The actual website seems to show --- _ in the site name so, we won't --- be replacing `_`s with ` `s. file = string.gsub(file, "%.html$", ""); return string.format("%s(%s) - Neovim docs", normalize_str(file), tag); end }, ["neovim%.io/doc/user/.*$"] = { icon = " ", hl = "MarkviewPalette4Fg", text = function (_, item) local file = string.match(item.destination, "neovim%.io/doc/user/(.*)$"); file = string.gsub(file, "%.html$", ""); return string.format("%s - Neovim docs", normalize_str(file)); end }, ["github%.com/vim/vim"] = { priority = -100, icon = " ", hl = "MarkviewPalette4Fg", }, ["github%.com/neovim/neovim"] = { priority = -100, icon = " ", hl = "MarkviewPalette4Fg", }, ["vim%.org"] = { icon = " ", hl = "MarkviewPalette4Fg", }, ["luals%.github%.io/wiki/?.*$"] = { icon = " ", hl = "MarkviewPalette5Fg", text = function (_, item) if string.match(item.destination, "luals%.github%.io/wiki/(.-)/#(.+)$") then local page_mappings = { annotations = { ["as"] = "@as", ["alias"] = "@alias", ["async"] = "@async", ["cast"] = "@cast", ["class"] = "@class", ["deprecated"] = "@deprecated", ["diagnostic"] = "@diagnostic", ["enum"] = "@enum", ["field"] = "@field", ["generic"] = "@generic", ["meta"] = "@meta", ["module"] = "@module", ["nodiscard"] = "@nodiscard", ["operator"] = "@operator", ["overload"] = "@overload", ["package"] = "@package", ["param"] = "@param", ["see"] = "@see", ["source"] = "@source", ["type"] = "@type", ["vaarg"] = "@vaarg", ["version"] = "@version" } }; local page, section = string.match(item.destination, "luals%.github%.io/wiki/(.-)/#(.+)$"); if page_mappings[page] and page_mappings[page][section] then section = page_mappings[page][section]; else section = normalize_str(string.gsub(section, "%-", " ")); end return string.format("%s(%s) | Lua Language Server", normalize_str(page), section); elseif string.match(item.destination, "") then local page = string.match(item.destination, "luals%.github%.io/wiki/(.-)/?$"); return string.format("%s | Lua Language Server", normalize_str(page)); else return item.destination; end end }, ---|fE } ``` -------------------------------- ### URI Configuration Example Source: https://github.com/oxy2dev/markview.nvim/wiki/Asciidoc inline Example configuration for various URIs, including custom text formatting for Neovim and Lua Language Server documentation links. ```lua hl = "MarkviewPalette0Fg" }, ["pypi%.org"] = { priority = -9999, icon = "󰆦 ", hl = "MarkviewPalette0Fg" }, ["mvnrepository%.com"] = { priority = -9999, icon = " ", hl = "MarkviewPalette1Fg" }, ["medium%.com"] = { priority = -9999, icon = " ", hl = "MarkviewPalette6Fg" }, ["linkedin%.com"] = { priority = -9999, icon = "󰌻 ", hl = "MarkviewPalette5Fg" }, ["news%.ycombinator%.com"] = { priority = -9999, icon = " ", hl = "MarkviewPalette2Fg" }, ["neovim%.io/doc/user/.*#%_?.*$"] = { icon = " ", hl = "MarkviewPalette4Fg", text = function (_, item) local file, tag = string.match(item.destination, "neovim%.io/doc/user/(.*)#%_?(.*)$"); --- --- The actual website seems to show --- --- _ in the site name so, we won't --- --- be replacing `_`s with ` `s. file = string.gsub(file, "%.html$", ""); return string.format("%s(%s) - Neovim docs", normalize_str(file), tag); end }, ["neovim%.io/doc/user/.*$"] = { icon = " ", hl = "MarkviewPalette4Fg", text = function (_, item) local file = string.match(item.destination, "neovim%.io/doc/user/(.*)$"); file = string.gsub(file, "%.html$", ""); return string.format("%s - Neovim docs", normalize_str(file)); end }, ["github%.com/vim/vim"] = { priority = -100, icon = " ", hl = "MarkviewPalette4Fg", }, ["github%.com/neovim/neovim"] = { priority = -100, icon = " ", hl = "MarkviewPalette4Fg", }, ["vim%.org"] = { icon = " ", hl = "MarkviewPalette4Fg", }, ["luals%.github%.io/wiki/?.*$"] = { icon = " ", hl = "MarkviewPalette5Fg", text = function (_, item) if string.match(item.destination, "luals%.github%.io/wiki/(.-)/#(.+)$") then local page_mappings = { annotations = { ["as"] = "@as", ["alias"] = "@alias", ["async"] = "@async", ["cast"] = "@cast", ["class"] = "@class", ["deprecated"] = "@deprecated", ["diagnostic"] = "@diagnostic", ["enum"] = "@enum", ["field"] = "@field", ["generic"] = "@generic", ["meta"] = "@meta", ["module"] = "@module", ["nodiscard"] = "@nodiscard", ["operator"] = "@operator", ["overload"] = "@overload", ["package"] = "@package", ["param"] = "@param", ["see"] = "@see", ["source"] = "@source", ["type"] = "@type", ["vaarg"] = "@vaarg", ["version"] = "@version" } }; local page, section = string.match(item.destination, "luals%.github%.io/wiki/(.-)/#(.+)$"); if page_mappings[page] and page_mappings[page][section] then section = page_mappings[page][section]; else section = normalize_str(string.gsub(section, "%-`, " ")); end return string.format("%s(%s) | Lua Language Server", normalize_str(page), section); elseif string.match(item.destination, "") then local page = string.match(item.destination, "luals%.github%.io/wiki/(.-)/?$"); return string.format("%s | Lua Language Server", normalize_str(page)); else return item.destination; end end }, ---|fE }, ``` } ], ``` ```lua --[[ Options for a specific highlight type. ]] ---@alias markview.config.asciidoc_inline.uris.opts markview.config.__inline ``` -------------------------------- ### Heading level changer setup Source: https://github.com/oxy2dev/markview.nvim/wiki/Extras Setup function for the heading level changer module. ```lua require("markview.extras.headings").setup(); ``` -------------------------------- ### Example Metadata Plus Configuration Source: https://github.com/oxy2dev/markview.nvim/wiki/Markdown An example of how to enable and configure the 'metadata_plus' option for displaying metadata with borders. ```lua metadata_plus = { enable = true, hl = "MarkviewCode", border_hl = "MarkviewCodeFg", border_top = "▄", border_bottom = "▀" }, ``` -------------------------------- ### Example Metadata Minus Configuration Source: https://github.com/oxy2dev/markview.nvim/wiki/Markdown Example Lua configuration for metadata sections using minus. ```lua metadata_minus = { enable = true, hl = "MarkviewCode", border_hl = "MarkviewCodeFg", border_top = "▄", border_bottom = "▀" }, ``` -------------------------------- ### List Items Example Configuration Source: https://github.com/oxy2dev/markview.nvim/blob/main/doc/markview.nvim-typst.txt Example configuration for list items, including dynamic indentation and specific marker styles. ```lua list_items = { enable = true, indent_size = function (buffer) if type(buffer) ~= "number" then return vim.bo.shiftwidth or 4; end --- Use 'shiftwidth' value. return vim.bo[buffer].shiftwidth or 4; end, shift_width = 4, marker_minus = { add_padding = true, text = "●", hl = "MarkviewListItemMinus" }, marker_plus = { add_padding = true, text = "%d)", hl = "MarkviewListItemPlus" }, marker_dot = { add_padding = true, text = "%d.", hl = "MarkviewListItemStar" } }, ``` -------------------------------- ### Highlight Text Example Source: https://github.com/oxy2dev/markview.nvim/blob/main/doc/markview.nvim-asciidoc_inline.txt Example configuration for enabling and setting default highlight styles. ```lua highlights = { enable = true, default = { padding_left = " ", padding_right = " ", hl = "MarkviewPalette3" } }, ```