Skip to content

Commit

Permalink
fix(docgen): better mnemonic rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
vhyrro committed Jul 16, 2024
1 parent e23d0d3 commit b3bf963
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docgen/docgen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -613,9 +613,9 @@ docgen.generators = {
table.insert(layout, "</summary>")
table.insert(layout, "")
vim.list_extend(layout, description)
table.insert(layout, string.format("- Default map: `%s`", data.rhs))
table.insert(layout, string.format("- Maps to: `%s`", data.rhs))
if mnemonic then
table.insert(layout, string.format("- Mnemonic: %s", docgen.format_mnemonic(mnemonic)))
table.insert(layout, string.format("- Mnemonic: <code>%s</code>", docgen.format_mnemonic(mnemonic)))
end
table.insert(layout, "")
table.insert(layout, "</details>")
Expand Down Expand Up @@ -868,7 +868,7 @@ docgen.parse_keybind_data = function(buffer)
end

docgen.format_mnemonic = function(str)
return str:gsub("([A-Z])", "`%1`")
return str:gsub("([A-Z])", "<strong>%1</strong>"):lower()
end

docgen.extract_mnemonic = function(comments)
Expand Down

0 comments on commit b3bf963

Please sign in to comment.