Skip to content

Commit

Permalink
Prefix all class definitions with render.md to avoid clashing with ot…
Browse files Browse the repository at this point in the history
…her plugins
  • Loading branch information
MeanderingProgrammer committed May 17, 2024
1 parent 04cc47f commit a731ce2
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 36 deletions.
4 changes: 2 additions & 2 deletions lua/render-markdown/handler/latex.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
local logger = require('render-markdown.logger')
local state = require('render-markdown.state')

---@class Cache
---@class render.md.Cache
---@field expressions table<string,string[]>

---@type Cache
---@type render.md.Cache
local cache = {
expressions = {},
}
Expand Down
30 changes: 15 additions & 15 deletions lua/render-markdown/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,37 @@ local ui = require('render-markdown.ui')

local M = {}

---@class UserTableHighlights
---@class render.md.UserTableHighlights
---@field public head? string
---@field public row? string

---@class UserCheckboxHighlights
---@class render.md.UserCheckboxHighlights
---@field public unchecked? string
---@field public checked? string

---@class UserHeadingHighlights
---@class render.md.UserHeadingHighlights
---@field public backgrounds? string[]
---@field public foregrounds? string[]

---@class UserHighlights
---@field public heading? UserHeadingHighlights
---@class render.md.UserHighlights
---@field public heading? render.md.UserHeadingHighlights
---@field public dash? string
---@field public code? string
---@field public bullet? string
---@field public checkbox? UserCheckboxHighlights
---@field public table? UserTableHighlights
---@field public checkbox? render.md.UserCheckboxHighlights
---@field public table? render.md.UserTableHighlights
---@field public latex? string
---@field public quote? string

---@class UserConceal
---@class render.md.UserConceal
---@field public default? integer
---@field public rendered? integer

---@class UserCheckbox
---@class render.md.UserCheckbox
---@field public unchecked? string
---@field public checked? string

---@class UserConfig
---@class render.md.UserConfig
---@field public start_enabled? boolean
---@field public max_file_size? number
---@field public markdown_query? string
Expand All @@ -44,15 +44,15 @@ local M = {}
---@field public headings? string[]
---@field public dash? string
---@field public bullets? string[]
---@field public checkbox? UserCheckbox
---@field public checkbox? render.md.UserCheckbox
---@field public quote? string
---@field public conceal? UserConceal
---@field public conceal? render.md.UserConceal
---@field public fat_tables? boolean
---@field public highlights? UserHighlights
---@field public highlights? render.md.UserHighlights

---@param opts? UserConfig
---@param opts? render.md.UserConfig
function M.setup(opts)
---@type Config
---@type render.md.Config
local default_config = {
start_enabled = true,
max_file_size = 1.5,
Expand Down
8 changes: 4 additions & 4 deletions lua/render-markdown/logger.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ local state = require('render-markdown.state')
-- Typically resolves to ~/.local/state/nvim/render-markdown.log
local log_file = vim.fn.stdpath('state') .. '/render-markdown.log'

---@class LogEntry
---@class render.md.LogEntry
---@field date string
---@field level string
---@field message string

---@class Log
---@field entries LogEntry[]
---@class render.md.Log
---@field entries render.md.LogEntry[]
local log = {
entries = {},
}
Expand All @@ -21,7 +21,7 @@ end
---@param level string
---@param message any
log.add = function(level, message)
---@type LogEntry
---@type render.md.LogEntry
local entry = {
---@diagnostic disable-next-line: assign-type-mismatch
date = os.date('%Y-%m-%d %H:%M:%S'),
Expand Down
30 changes: 15 additions & 15 deletions lua/render-markdown/state.lua
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
---@class TableHighlights
---@class render.md.TableHighlights
---@field public head string
---@field public row string

---@class CheckboxHighlights
---@class render.md.CheckboxHighlights
---@field public unchecked string
---@field public checked string

---@class HeadingHighlights
---@class render.md.HeadingHighlights
---@field public backgrounds string[]
---@field public foregrounds string[]

---@class Highlights
---@field public heading HeadingHighlights
---@class render.md.Highlights
---@field public heading render.md.HeadingHighlights
---@field public dash string
---@field public code string
---@field public bullet string
---@field public checkbox CheckboxHighlights
---@field public table TableHighlights
---@field public checkbox render.md.CheckboxHighlights
---@field public table render.md.TableHighlights
---@field public latex string
---@field public quote string

---@class Conceal
---@class render.md.Conceal
---@field public default integer
---@field public rendered integer

---@class Checkbox
---@class render.md.Checkbox
---@field public unchecked string
---@field public checked string

---@class Config
---@class render.md.Config
---@field public start_enabled boolean
---@field public max_file_size number
---@field public markdown_query string
Expand All @@ -39,14 +39,14 @@
---@field public headings string[]
---@field public dash string
---@field public bullets string[]
---@field public checkbox Checkbox
---@field public checkbox render.md.Checkbox
---@field public quote string
---@field public conceal Conceal
---@field public conceal render.md.Conceal
---@field public fat_tables boolean
---@field public highlights Highlights
---@field public highlights render.md.Highlights

---@class State
---@field config Config
---@class render.md.State
---@field config render.md.Config
---@field enabled boolean
---@field markdown_query vim.treesitter.Query
---@field inline_query vim.treesitter.Query
Expand Down

0 comments on commit a731ce2

Please sign in to comment.