Add data table markdown block
Some checks are pending
Build / build (push) Waiting to run

This commit is contained in:
Neeldhara Misra 2026-06-29 02:09:20 +05:30
parent 5dfcdfd516
commit c06f71a5ad
34 changed files with 3641 additions and 279 deletions

View file

@ -329,6 +329,27 @@ local function interactive_to_latex(el)
)
end
local function data_table_to_latex(el)
local caption = el.attributes.caption or el.attributes.title or "Data table"
local src = el.attributes.src or el.attributes.source or ""
local fallback = el.attributes.pdf or el.attributes.fallback or el.text
if fallback == "" then
if src ~= "" then
fallback = "The HTML version renders a searchable, sortable data table from `" .. src .. "`."
else
fallback = "The HTML version renders a searchable, sortable data table."
end
end
return pandoc.RawBlock(
"latex",
"\\begin{blogasidebox}{" .. latex_escape(caption) .. "}\n"
.. markdown_to_latex(fallback)
.. "\n\\end{blogasidebox}"
)
end
local function remove_first_inline(block)
if not block or block.t ~= "Para" or not block.content or #block.content == 0 then
return
@ -513,6 +534,10 @@ local function env_to_latex(el)
end
function CodeBlock(el)
if FORMAT:match("latex") and has_class(el, "data-table") then
return data_table_to_latex(el)
end
if FORMAT:match("latex") and has_class(el, "interactive") then
return interactive_to_latex(el)
end