CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 63
YAML
Tip
You can find the type definitions in definitions/renderers/yaml.lua.
Options that change how YAML blocks are shown are part of this. See default values in here.
---@type markview.config.yaml
yaml = {
enable = true,
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"
}
}
}
- type:
boolean
default:true
Allows previewing YAML.
Changes how YAML properties are shown.
---@type markview.config.yaml.properties
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 = " │ ",
border_middle = " │ ",
border_bottom = " ╰╸",
border_hl = "MarkviewComment"
},
["^tags$"] = {
match_string = "^tags$",
use_types = false,
text = " ",
hl = nil
},
["^aliases$"] = {
match_string = "^aliases$",
use_types = false,
text = " ",
hl = nil
},
["^cssclasses$"] = {
match_string = "^cssclasses$",
use_types = false,
text = " ",
hl = nil
},
["^publish$"] = {
match_string = "^publish$",
use_types = false,
text = " ",
hl = nil
},
["^permalink$"] = {
match_string = "^permalink$",
use_types = false,
text = " ",
hl = nil
},
["^description$"] = {
match_string = "^description$",
use_types = false,
text = " ",
hl = nil
},
["^image$"] = {
match_string = "^image$",
use_types = false,
text = " ",
hl = nil
},
["^cover$"] = {
match_string = "^cover$",
use_types = false,
text = " ",
hl = nil
}
},
- type:
boolean
default:true
Self-explanatory.
- type:
{ [string]: markview.config.yaml.properties.opts }
default
Configuration for various data types.
Configuration for YAML properties whose value is a text.
---@type markview.config.yaml.properties.opts
["text"] = {
text = " ",
hl = "MarkviewIcon4"
},
- type:
string | fun(bufnr: integer, item: markview.parsed.yaml.properties): string
Text shown before the property name(like an icon).
- type:
string | fun(bufnr: integer, item: markview.parsed.yaml.properties): string
Highlight group for text.
Configuration for YAML properties whose value is a list. Same as text.
Configuration for YAML properties whose value is a number. Same as text.
Configuration for YAML properties whose value is a boolean. Same as text.
Also see,
- experimental.date_formats, for patterns used to detect date from strings.
Configuration for YAML properties whose value is a date. Same as text.
Also see,
- experimental.date_time_formats, for patterns used to detect date & time from strings.
Configuration for YAML properties whose value is a date & time. Same as text.
Default configuration for YAML properties.
- type:
boolean
default:true
Whether to use the data types configuration. See data_types.
- type:
string | fun(bufnr: integer, item: markview.parsed.yaml.properties): string
Text shown before the property name(like an icon).
- type:
string | fun(bufnr: integer, item: markview.parsed.yaml.properties): string
Highlight group for text.
Configuration for YAML properties that match string
. Same as default.