Skip to content

Instantly share code, notes, and snippets.

local system = require 'pandoc.system'
local tex_template = [[
\documentclass{article}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage[active,tightpage]{preview}
\usepackage{fontspec}
\usepackage{unicode-math}
\setmathfont{Latin Modern Math}
\begin{document}
mas.to##[class*="name"]
acgnx.se##img
x.com##[data-testid*="Name"]
! x.com##[data-testid*="User"], [data-testid*="Context"],
x.com##[aria-label="Subscribe to Premium"]
x.com##[href="/i/premium_sign_up"]
! https://*.fandom.com
@dbdowjfb
dbdowjfb / date_filter.lua
Last active August 22, 2024 23:55
Date and Time Filter for Pandoc. (Example of locating and operating on strings in a fixed format using Pandoc Lua filter)
-- Date filter for pandoc
-- If the whole paragraph is just a date and time, then do nothing.
-- Otherwise, encoutering a date and time in the middle of a paragraph, change it
-- to a span.
Para = function(_)
-- if the paragraph matches the time format,
-- then add the time css class
if #_.content == 3 then