From 098d7fd8814c7c74ef7e262e540a9156a8b950c7 Mon Sep 17 00:00:00 2001 From: Baldur Kristinsson Date: Tue, 12 Feb 2013 11:32:11 +0000 Subject: [PATCH] Added support for textile and mediawiki formats and options for bibliography/csl --- pandoc.pm | 49 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/pandoc.pm b/pandoc.pm index ec3706d..b401625 100755 --- a/pandoc.pm +++ b/pandoc.pm @@ -13,7 +13,7 @@ sub import { hook(type => "getsetup", id => "pandoc", call => \&getsetup); hook(type => "htmlize", id => $markdown_ext, - # longname => "Pandoc Markdown", + # longname => "Pandoc Markdown", call => sub { htmlize("markdown", @_) }); if ($config{pandoc_latex}) { hook(type => "htmlize", id => "tex", @@ -23,6 +23,14 @@ sub import { hook(type => "htmlize", id => "rst", call => sub { htmlize("rst", @_) }); } + if ($config{pandoc_textile}) { + hook(type => "htmlize", id => "textile", + call => sub { htmlize("textile", @_) }); + } + if ($config{pandoc_mediawiki}) { + hook(type => "htmlize", id => "mediawiki", + call => sub { htmlize("mediawiki", @_) }); + } } @@ -60,6 +68,20 @@ sub getsetup () { safe => 0, rebuild => 1, }, + pandoc_textile => { + type => "boolean", + example => 0, + description => "Enable Pandoc processing of Textile documents", + safe => 0, + rebuild => 1, + }, + pandoc_mediawiki => { + type => "boolean", + example => 0, + description => "Enable Pandoc processing of MediaWiki documents", + safe => 0, + rebuild => 1, + }, pandoc_smart => { type => "boolean", example => 1, @@ -111,11 +133,25 @@ sub getsetup () { }, pandoc_math => { type => "string", - example => "unicode", + example => "mathjax", description => "Process TeX math using", safe => 0, rebuild => 1, }, + pandoc_bibliography => { + type => "string", + example => "", + description => "Path to bibliography file", + safe => 0, + rebuild => 1, + }, + pandoc_csl => { + type => "string", + example => "", + description => "Path to CSL file (for references and bibliography)", + safe => 0, + rebuild => 1, + }, } @@ -159,9 +195,16 @@ sub htmlize ($@) { push @args, '--indented-code-classes=' . $config{pandoc_codeclasses}; }; + if ($config{pandoc_bibliography}) { + push @args, '--bibliography="'.$config{pandoc_bibliography}.'"'; + } + + if ($config{pandoc_csl}) { + push @args, '--csl="'.$config{pandoc_csl}.'"'; + } for ($config{pandoc_math}) { - if (/^mathjax$/) { + if (/^mathjax$/) { push @args, '--mathjax=/dev/null'; } elsif (/^jsmath$/) { -- 2.39.2