Skip to content

Commit a731ce2

Browse files
Prefix all class definitions with render.md to avoid clashing with other plugins
1 parent 04cc47f commit a731ce2

File tree

4 files changed

+36
-36
lines changed

4 files changed

+36
-36
lines changed

lua/render-markdown/handler/latex.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
local logger = require('render-markdown.logger')
22
local state = require('render-markdown.state')
33

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

7-
---@type Cache
7+
---@type render.md.Cache
88
local cache = {
99
expressions = {},
1010
}

lua/render-markdown/init.lua

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,37 @@ local ui = require('render-markdown.ui')
33

44
local M = {}
55

6-
---@class UserTableHighlights
6+
---@class render.md.UserTableHighlights
77
---@field public head? string
88
---@field public row? string
99

10-
---@class UserCheckboxHighlights
10+
---@class render.md.UserCheckboxHighlights
1111
---@field public unchecked? string
1212
---@field public checked? string
1313

14-
---@class UserHeadingHighlights
14+
---@class render.md.UserHeadingHighlights
1515
---@field public backgrounds? string[]
1616
---@field public foregrounds? string[]
1717

18-
---@class UserHighlights
19-
---@field public heading? UserHeadingHighlights
18+
---@class render.md.UserHighlights
19+
---@field public heading? render.md.UserHeadingHighlights
2020
---@field public dash? string
2121
---@field public code? string
2222
---@field public bullet? string
23-
---@field public checkbox? UserCheckboxHighlights
24-
---@field public table? UserTableHighlights
23+
---@field public checkbox? render.md.UserCheckboxHighlights
24+
---@field public table? render.md.UserTableHighlights
2525
---@field public latex? string
2626
---@field public quote? string
2727

28-
---@class UserConceal
28+
---@class render.md.UserConceal
2929
---@field public default? integer
3030
---@field public rendered? integer
3131

32-
---@class UserCheckbox
32+
---@class render.md.UserCheckbox
3333
---@field public unchecked? string
3434
---@field public checked? string
3535

36-
---@class UserConfig
36+
---@class render.md.UserConfig
3737
---@field public start_enabled? boolean
3838
---@field public max_file_size? number
3939
---@field public markdown_query? string
@@ -44,15 +44,15 @@ local M = {}
4444
---@field public headings? string[]
4545
---@field public dash? string
4646
---@field public bullets? string[]
47-
---@field public checkbox? UserCheckbox
47+
---@field public checkbox? render.md.UserCheckbox
4848
---@field public quote? string
49-
---@field public conceal? UserConceal
49+
---@field public conceal? render.md.UserConceal
5050
---@field public fat_tables? boolean
51-
---@field public highlights? UserHighlights
51+
---@field public highlights? render.md.UserHighlights
5252

53-
---@param opts? UserConfig
53+
---@param opts? render.md.UserConfig
5454
function M.setup(opts)
55-
---@type Config
55+
---@type render.md.Config
5656
local default_config = {
5757
start_enabled = true,
5858
max_file_size = 1.5,

lua/render-markdown/logger.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ local state = require('render-markdown.state')
33
-- Typically resolves to ~/.local/state/nvim/render-markdown.log
44
local log_file = vim.fn.stdpath('state') .. '/render-markdown.log'
55

6-
---@class LogEntry
6+
---@class render.md.LogEntry
77
---@field date string
88
---@field level string
99
---@field message string
1010

11-
---@class Log
12-
---@field entries LogEntry[]
11+
---@class render.md.Log
12+
---@field entries render.md.LogEntry[]
1313
local log = {
1414
entries = {},
1515
}
@@ -21,7 +21,7 @@ end
2121
---@param level string
2222
---@param message any
2323
log.add = function(level, message)
24-
---@type LogEntry
24+
---@type render.md.LogEntry
2525
local entry = {
2626
---@diagnostic disable-next-line: assign-type-mismatch
2727
date = os.date('%Y-%m-%d %H:%M:%S'),

lua/render-markdown/state.lua

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
---@class TableHighlights
1+
---@class render.md.TableHighlights
22
---@field public head string
33
---@field public row string
44

5-
---@class CheckboxHighlights
5+
---@class render.md.CheckboxHighlights
66
---@field public unchecked string
77
---@field public checked string
88

9-
---@class HeadingHighlights
9+
---@class render.md.HeadingHighlights
1010
---@field public backgrounds string[]
1111
---@field public foregrounds string[]
1212

13-
---@class Highlights
14-
---@field public heading HeadingHighlights
13+
---@class render.md.Highlights
14+
---@field public heading render.md.HeadingHighlights
1515
---@field public dash string
1616
---@field public code string
1717
---@field public bullet string
18-
---@field public checkbox CheckboxHighlights
19-
---@field public table TableHighlights
18+
---@field public checkbox render.md.CheckboxHighlights
19+
---@field public table render.md.TableHighlights
2020
---@field public latex string
2121
---@field public quote string
2222

23-
---@class Conceal
23+
---@class render.md.Conceal
2424
---@field public default integer
2525
---@field public rendered integer
2626

27-
---@class Checkbox
27+
---@class render.md.Checkbox
2828
---@field public unchecked string
2929
---@field public checked string
3030

31-
---@class Config
31+
---@class render.md.Config
3232
---@field public start_enabled boolean
3333
---@field public max_file_size number
3434
---@field public markdown_query string
@@ -39,14 +39,14 @@
3939
---@field public headings string[]
4040
---@field public dash string
4141
---@field public bullets string[]
42-
---@field public checkbox Checkbox
42+
---@field public checkbox render.md.Checkbox
4343
---@field public quote string
44-
---@field public conceal Conceal
44+
---@field public conceal render.md.Conceal
4545
---@field public fat_tables boolean
46-
---@field public highlights Highlights
46+
---@field public highlights render.md.Highlights
4747

48-
---@class State
49-
---@field config Config
48+
---@class render.md.State
49+
---@field config render.md.Config
5050
---@field enabled boolean
5151
---@field markdown_query vim.treesitter.Query
5252
---@field inline_query vim.treesitter.Query

0 commit comments

Comments
 (0)