Skip to content

Instantly share code, notes, and snippets.

View lyndondrake's full-sized avatar

Lyndon Drake lyndondrake

View GitHub Profile
@bpj
bpj / pandoc-class2style.pl
Last active June 9, 2017 12:55
pandoc-class2style.pl - filter to translate single pandoc classes into attribute lists or LaTeX commands (with POD documentation)
#!/usr/bin/env perl
# pandoc-class2style.pl - filter to translate single span/div classes into LaTeX commands and attribute lists
# POD documentation below the code!
use utf8;
use autodie 2.29;
use 5.010001;
use strict;
import Text.Pandoc.JSON
import Text.Parsec
import Control.Applicative
import Data.Monoid
main :: IO ()
main = toJSONFilter index
index :: Maybe Format -> Inline -> [Inline]
index (Just (Format f)) c@(Code _ s) =