Skip to content

Instantly share code, notes, and snippets.

View tarleb's full-sized avatar
🌱
Growing some software

Albert Krewinkel tarleb

🌱
Growing some software
View GitHub Profile
-- jsonld.lua
--
-- Copyright (c) 2017-2018 Albert Krewinkel, Robert Winkler
--
-- This program is free software; you can redistribute it and/or modify it
-- under the terms of the GNU public license version 2 or later.
-- See the LICENSE file for details.
-- USAGE:
-- The filters cito.lua and scholarly-metadata.lua must be run before this filter.
@tarleb
tarleb / section-refs.lua
Created January 4, 2018 20:09
Ugly, proof of concept filter to create section refs.
dkjson = require 'dkjson'
List = require 'pandoc.List'
utils = require 'pandoc.utils'
CitationOrig = pandoc.Citation
-- monkey-patch citation creation
pandoc.Citation = function(id, mode, prefix, suffix, note_num, hash)
local res = CitationOrig(id, mode, prefix, suffix, note_num, hash)
setmetatable(
@tarleb
tarleb / latex-short-captions.lua
Last active June 14, 2019 22:43
Filter to turn figure titles into short captions in LaTeX
-- don't do anything unless we target latex
if FORMAT ~= "latex" then
return {}
end
local List = require'pandoc.List'
local function latex(str)
return List:new{pandoc.RawInline('latex', str)}
end
@tarleb
tarleb / pandoc-schema.json
Last active January 26, 2023 03:26
Schema for pandoc json
{
"$schema": "http://json-schema.org/draft-04/schema#",
"definitions": {
"Attr": {
"type": "array",
"items": [
{"type": "string"},
{"type": "array", "items": {"type": "string"}},
{
"type": "array",