Skip to content

Instantly share code, notes, and snippets.

View HuangxinDong's full-sized avatar

Huangxin Dong HuangxinDong

View GitHub Profile
@HuangxinDong
HuangxinDong / highlight.lua
Created January 31, 2026 20:35
Pandoc Lua filters for markdown notes: convert ==highlight== syntax to colorbox
-- highlight.lua
-- Converts ==highlighted text== to LaTeX \mdhighlight{} command (CJK compatible)
function Span(el)
if el.classes[1] == "mark" then
return pandoc.RawInline('latex', '\\mdhighlight{' .. pandoc.utils.stringify(el.content) .. '}')
end
end
function Str(el)
@HuangxinDong
HuangxinDong / obsidian-callouts.lua
Created January 31, 2026 20:34
Pandoc Lua filters for Obsidian notes: convert callout blocks (>[!note]) to LaTeX tcolorbox
-- obsidian-callouts.lua
-- Converts Obsidian callout blocks to LaTeX tcolorbox
-- Callout type to color mapping
local callout_colors = {
note = {bg = "blue!5!white", border = "blue!60!black"},
info = {bg = "cyan!5!white", border = "cyan!60!black"},
tip = {bg = "teal!5!white", border = "teal!60!black"},
warning = {bg = "orange!5!white", border = "orange!80!black"},
caution = {bg = "orange!5!white", border = "orange!80!black"},