Skip to content

Commit

Permalink
od format
Browse files Browse the repository at this point in the history
  • Loading branch information
clpi committed Jan 18, 2025
1 parent 1a253a8 commit 2f4c7cb
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions lua/down/mod/mod/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ M.print = {
deps = function(m, tb, pre)
pre = pre or ''
if m.dependencies and not vim.tbl_isempty(m.dependencies) then
ins(tb, pre .. '' .. '- **Dependencies:**')
ins(tb, '')
ins(tb, '#### **Dependencies**')
for i, d in ipairs(m.dependencies) do
local ix = M.print.index(i, pre .. '\t')
ins(tb, ix .. '' .. '`' .. d .. '`')
local ix = M.print.index(i, pre)
ins(tb, ix .. '' .. '[' .. d .. '](#' .. d .. ')')
end
end
end,
Expand All @@ -54,7 +55,6 @@ M.print = {
if value ~= '' then
value = '`' .. value .. '`'
end
title = title or ''
local ix
if i then
ix = i .. '. '
Expand All @@ -70,29 +70,34 @@ M.print = {
enabled = '**enabled**: ' .. '`' .. tostring(v.enabled) .. '`'
end
ins(tb, index .. ' __' .. cmd .. "__ `" .. (v.name or '') .. '`' .. ' ' .. enabled)
M.print.commands(v, tb, cmd, pre, i)
M.print.commands(v, tb, cmd, pre .. '\t', i)
end,
commands = function(m, tb, name, pre, i)
pre = pre or '\t'
pre = pre or ''
ix = M.print.index(nil, pre)
if m.commands then
if vim.tbl_isempty(m.commands) then
return
end
if pre == '' then
ins(tb, ix .. '**Commands:**')
ins(tb, '')
ins(tb, '#### **Commands**')
end
local i = 0
for k, v in pairs(m.commands) do
i = i + 1
if pre == '' then
else
end
local ix = M.print.index(i, pre)
M.print.command(tb, pre .. '\t', k, v, i)
M.print.command(tb, pre, k, v, i)
end
end
end,
mod = function(m, tb, i, name)
local ix = M.print.index(i)
ins(tb, '### ' .. (i or '') .. '. ' .. string.upper(string.sub(name, 1, 1)) .. string.sub(name, 2))
local i = (i or '') .. '.'
ins(tb, '### ' .. '' .. ' ' .. name)
ins(tb, '')
-- ins(tb, .. '`' .. (name or m.name or '') .. '`')
-- M.print.commands(m, tb, m.name, '', i)
Expand Down

0 comments on commit 2f4c7cb

Please sign in to comment.